Guides

Python SDK

from dev_guru import GuruClient

with GuruClient(workspace="path/to/project") as guru:
    print(guru.doctor().compatible)              # True when Ananke is in range
    result = guru.explore(name="My project")     # Ananke builds the graph; Dev Guru projects it
    page = guru.export(result, output="reports/explorer.html")

print(result.model["project"])     # {'files': 25, 'symbols': 146, 'imports': 26, 'calls': 88, ...}
print(result.manifest["input_digest"])
CallReturns
GuruClient(workspace=".", transport="in-process")a client bound to one explicit transport
.doctor()HarnessInfo: Ananke version, supported range, capabilities, reasons if incompatible
.explore(name=None)ExploreResult: the view model (dev-guru/explorer@1), its manifest and the transport
.export(result, output=..., format="html")the path of the written report (a manifest goes next to it)

Errors

Failures raise dev_guru.errors.GuruError with a stable code, so branch on the code rather than on the message:

CodeWhen
HARNESS_MISSINGAnanke Plexus isn’t installed
HARNESS_INCOMPATIBLEits version is outside the supported range
CAPABILITY_MISSINGit lacks a capability Dev Guru needs
UNSUPPORTED_TRANSPORTyou asked for a transport that doesn’t exist (no silent fallback)
WORKSPACE_INVALIDthe folder doesn’t exist, or holds no Python files
HARNESS_FAILEDAnanke reported success but stored nothing

The lower-level port

dev_guru.client.connect() returns the AnankeClient port directly: info(), graph_data(workspace) (the graph as plain data) and graph_summary(workspace). Everything Dev Guru knows about your code comes through this one port.

Edit this page on GitHub ↗