{ } Raw JSON

bundles / papyri latest / papyri / cli / debug / debug

function

papyri.cli.debug:debug

source: /papyri/cli/debug.py :117

Signature

def   debug ( path : Annotated[str, typer.Argument(help="Path to a bundle IR file to inspect (.json for data-tree files, .cbor for ingest-tree files, .papyri for packed artifacts). Can be an absolute/relative path, or a shorthand relative to ~/.papyri/data/ (e.g. 'numpy_2.3.5/module/numpy.linspace'). The extension is added automatically when absent.")] object_path : Annotated[str | None, typer.Argument(help="Optional: name of a single object inside a .papyri artifact to print as JSON on stdout (for piping into jq and friends). May carry a kind prefix: 'module:numpy.linspace', 'docs:intro', 'examples:foo'. A bare name searches api, narrative, then examples. All human-readable context is suppressed so stdout is pure JSON.")] = None )  →  None

Summary

Print the contents of a CBOR file in human-readable form.

Extended Summary

Accepts: - An absolute or relative path to any .cbor file. - A shorthand path relative to ~/.papyri/data/ — the .cbor extension is appended automatically if the file is not found without it.

When the file lives inside the ingest tree (~/.papyri/ingest/) the command also prints backrefs from the graph store.

When the file lives inside the data tree (~/.papyri/data/) the command prints the bundle context (package, version, kind) derived from the path.

Tries to decode using the papyri IR tag registry first; falls back to plain cbor2 if the file does not contain tagged IR objects.

A .papyri artifact (output of papyri pack) is also accepted: the artifact is gunzipped + decoded to a Bundle Node and pretty- printed in place of the file-tree-walk path.

Pass a second object_path argument to print a single object from a .papyri artifact as JSON on stdout, with no other output, so it can be piped into tools like jq

papyri debug numpy.papyri module:numpy.linspace | jq .signature

Aliases

  • papyri.debug