source-graph
Extract, store, and visualize code relationships.
Overview
source-graph treats code as a container of relationships. It extracts relationships from source files, stores them in a structured format, and presents them as an interactive HTML visualization.
Architecture: Extractor → Store → Presenter
Installation
Requires Python 3.9+.
pip install -e .
Usage
CLI
The CLI has two subcommands: extract and serve.
Extract relationships to a database
source-graph extract src/*.py --output build/
This creates build/source_graph.db containing the extracted nodes and relations.
Serve an interactive report from a database
source-graph serve build/source_graph.db
This starts an HTTP server at http://127.0.0.1:8080 that serves the interactive report directly from the database, without generating a file on disk. Use --host and --port to customize the binding.
Library
from source_graph import RelationStore, PythonStructureExtractor
store = RelationStore()
extractor = PythonStructureExtractor()
nodes, relations = extractor.extract("my_module.py")
store.add_nodes(nodes)
store.add_relations(relations)
store.save("output.db")
Development
# Run tests
python -m pytest
# Run on the project itself
bash scripts/run-self-analysis.sh
Milestone 1
- Extractor: Python AST-based structure extraction (file → class → method/function)
- Store: In-memory store with JSON persistence
- Presenter: Interactive HTML with expand/collapse, dimension switching, and hover details
License
MIT
Metadata
Release files for source-graphh 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| source_graphh-0.0.1.tar.gz | 632.1 kB | With provenance | Details for source_graphh-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| source_graphh-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for source_graphh-0.0.1-py3-none-any.whl |
Total release size: 655.9 kB
Release files / source_graphh-0.0.1.tar.gz
| Download URL | source_graphh-0.0.1.tar.gz |
|---|---|
| Size | 632.1 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
63442b1e5a73521d7a61c4bb74d7d1c1818677dee526a7cd4c43e9831591990e
|
|
BLAKE2b-256 checksum How to use checksums |
c1e81162a66afc1f7543cadcb842c92db1ab5c8590b5699f3e531fddcc4b0cb0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logRelease files / source_graphh-0.0.1-py3-none-any.whl
| Download URL | source_graphh-0.0.1-py3-none-any.whl |
|---|---|
| Size | 23.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
e2035459d91cd953e1fd7884c61d14f82f3647b936d10a455faa003593090a0f
|
|
BLAKE2b-256 checksum How to use checksums |
a9e4817e34fafa56c4a1cb31374e914860986a45deb9d941a0375382b59a80e0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logSecurity for source-graphh 0.0.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for source_graphh-0.0.1.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on May 20, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.