Skip to main content

repocli for Python

Native organization inspection for Git repositories: discover Components, language and package-tool evidence, then locate the owner of a repository-relative path. Python 3.11+ on macOS/Linux and Git on PATH are required. Organization analysis runs in Python; Git provides version-control facts through batched commands.

Install from the repository checkout:

python -m pip install ./toolkit/python
from repocli import inspect, owner

report = inspect("/path/to/repo", timeout=5)
if not report.complete:
    raise RuntimeError(report.diagnostics)
component = owner(report, "server/main.py")
if component is not None:
    print(component.name, component.root, component.language)

inspect(..., staged=True) selects the index; inspect(..., head="HEAD") selects a resolved commit. The default observes the working tree, including non-ignored untracked paths. timeout is a whole-call budget in seconds; an optional threading.Event passed as cancel requests cancellation. Git processes are terminated and reaped on timeout, cancellation or output overflow. Filesystem reads and Python analysis check the budget between operations. Timeout raises TimeoutError, cancellation raises InterruptedError, invalid selections/configuration or limits raise ValueError, and filesystem/Git failures propagate OSError / subprocess.CalledProcessError.

Reports and their nested collections are immutable dataclasses and tuples. Shared Repository, Component, Product and Forge identities come from harness-common; ComponentBinding adds checkout layout and tool evidence. owner accepts a repository-relative path and returns the deepest binding or None, including for deleted paths. Python properties use snake_case; these objects are not a CLI JSON protocol adapter.

Inspection reads filenames and necessary metadata, not source contents or ASTs. It never runs project code or installs dependencies. complete concerns observed organization; concurrent metadata changes return an incomplete report with diagnostics. Consumers own acceptance, command selection and validation policy. Snapshot, diff and graph analysis remain available through the Go toolkit / CLI.

Development: uv sync --locked, then make fix, make lint, make test, make build. Tests consume the shared conformance/inspect cases and generated filename probes. See the inspection contract.

Metadata

Release files for compforge-repocli 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for compforge-repocli 0.1.0
File Size Uploaded
compforge_repocli-0.1.0.tar.gz 39.1 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for compforge-repocli 0.1.0
File Interpreter ABI Platform
compforge_repocli-0.1.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.4 kB

Release files / compforge_repocli-0.1.0.tar.gz

Download URL compforge_repocli-0.1.0.tar.gz
Size 39.1 kB
Tags Source
SHA-256 checksum
How to use checksums
b4045a323a3a73a714ed676656df5a06d4e17fa4734f6320d07668b6826932b2
BLAKE2b-256 checksum
How to use checksums
96ca76b3c7c04a943b1a173331c0bd6e903f89516c45c02b9a60d8b8cdf0c3ec
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release files / compforge_repocli-0.1.0-py3-none-any.whl

Download URL compforge_repocli-0.1.0-py3-none-any.whl
Size 16.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
eb2ceac23f5a078ba0a9eaf1e7a7266e77b4d2ddd5aaa3236f98dd0cfdfc5d07
BLAKE2b-256 checksum
How to use checksums
b5d05186a32701d5e6bfe5b644ccb218007765e91cad784b44f14f32581a8bf7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via uv/0.9.2

Release history Release notifications | RSS feed

0.5.0

2 release files

0.2.1

2 release files

0.2.0

2 release files

This release

0.1.0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page