Skip to main content

Thin, typed Python SDK for the Mycelium code-intelligence engine. Wraps the prebuilt mycelium CLI — no Rust/Cargo toolchain required.

Project description

mycelium-rcig

Thin, typed Python SDK for Mycelium — the reactive, AI-native code-intelligence graph. Embed code intelligence in any Python app without a Rust toolchain.

The SDK is a thin wrapper over the prebuilt mycelium CLI: it locates the binary, spawns it with --format json, and returns parsed objects. Because it wraps the CLI, it inherits the CLI ↔ MCP byte-identical parity guaranteed by the Charter's Three-Surface Rule — see RFC-0111.

Naming. The PyPI distribution is mycelium-rcig (the short name mycelium is taken by an unrelated package), mirroring the crates.io mycelium-rcig-* prefix. The import package is mycelium_rcig.

Install

pip install mycelium-rcig

You also need the mycelium CLI on your machine. Install it via npm (npm install -g @aimasteracc/mycelium), cargo (cargo install mycelium-rcig-cli), or point the SDK at a binary with the MYCELIUM_BIN environment variable.

Quickstart

from mycelium_rcig import Mycelium

m = Mycelium(root=".")

m.index()                                   # build/refresh the index
hits = m.query("#login")                    # Hyphae selector → parsed JSON
info = m.get_symbol_info("src/lib.rs>App>render")
ctx  = m.context("trace ServeHTTP to HandlerFunc", max_nodes=30)

API

Method CLI twin
version() mycelium version
index(path=None) mycelium index
query(expr) mycelium query --format json
search_symbol(query, limit=None) mycelium search-symbol --format json
get_symbol_info(path) mycelium get-symbol-info --format json
get_callers(path, edge_kind=None, include_virtual=False, budget=None) mycelium get-callers --format json
get_callees(path, edge_kind=None, budget=None) mycelium get-callees --format json
context(task, max_nodes=None, max_code_blocks=None, budget=None) mycelium context --format json
server_status() mycelium server-status --format json
run(args) any subcommand — raw argv escape hatch

Every command the CLI exposes is reachable via run(["<subcommand>", ..., "--format", "json"]), even before it has a typed convenience method.

Binary resolution

The binary is located in this order:

  1. MYCELIUM_BIN environment variable (explicit override),
  2. mycelium on your PATH,
  3. the bare command name (the OS resolves it at spawn time).

Pass bin="/path/to/mycelium" to the constructor to pin one directly.

Errors

Failures raise a MyceliumError carrying code, signal, stderr, stdout, and args_ (the CLI argv).

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mycelium_rcig-0.3.0.tar.gz (8.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mycelium_rcig-0.3.0-py3-none-any.whl (7.1 kB view details)

Uploaded Python 3

File details

Details for the file mycelium_rcig-0.3.0.tar.gz.

File metadata

  • Download URL: mycelium_rcig-0.3.0.tar.gz
  • Upload date:
  • Size: 8.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for mycelium_rcig-0.3.0.tar.gz
Algorithm Hash digest
SHA256 369e19efd53dbe2c385ed5433e4bb6e684338422db77a6db53a8cdb414e5b064
MD5 9cd9bc8d6d17dcb4d61a707146941342
BLAKE2b-256 6a0a7fc0a22175a97cc4e23098659fe486d64d03e4db979ca2a2b7d5389187ba

See more details on using hashes here.

File details

Details for the file mycelium_rcig-0.3.0-py3-none-any.whl.

File metadata

  • Download URL: mycelium_rcig-0.3.0-py3-none-any.whl
  • Upload date:
  • Size: 7.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for mycelium_rcig-0.3.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b1e81aa9391d314ff0edff5cbd55aa42d47f603346643f0a6f12a23ed4cb1990
MD5 02744270461695205e7489e3a9148506
BLAKE2b-256 2499a948abf0b1c3637356478b2f4e6bb94900eae15add445587fc6aaff54403

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page