cellgraph
The cell graph of a notebook or script. A cell is source with a leading
# @key value block; the set of annotations is the host's, composed from the
ten effects the package implements (binds, defines, reads, keeps, after, seeds,
member, fan-out, input, no-cache). analyze reads every cell's names and
annotations, applies their effects, wires the DAG, says which cells can be
planned and why the others cannot, and keys each cell: a definition key from its
normalized source and the annotations that change what it computes, and an
execution key from the outputs and external inputs the host looks up. The
package has no dependencies and runs nothing; the host executes, stores and
resolves. It was factored out of Strata's notebook, its first host, whose
formats it reproduces exactly under legacy-1.
pip install cellgraph
See the API.
import cellgraph as cg
vocab = cg.Vocabulary.core() | cg.Vocabulary(
[
cg.Annotation("gpu", parse=cg.scalar(str), in_key=False),
]
)
analysis = cg.analyze(
[cg.Cell("a", "x = 1\n"), cg.Cell("b", "# @gpu A100\ny = x + 1\n")],
vocab,
)
analysis.cells["b"].annotations["gpu"] # 'A100'
analysis.dag.topological_order # ['a', 'b']
Development
uv sync
uv run pytest
uv run pre-commit run --all-files
Metadata
Release files for cellgraph 0.2.0
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 |
|---|---|---|---|---|
| cellgraph-0.2.0.tar.gz | 36.8 kB | With provenance | Details for cellgraph-0.2.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| cellgraph-0.2.0-py3-none-any.whl | Python 3 | none | any | Details for cellgraph-0.2.0-py3-none-any.whl |
Total release size: 77.7 kB
Release files / cellgraph-0.2.0.tar.gz
| Download URL | cellgraph-0.2.0.tar.gz |
|---|---|
| Size | 36.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
b17a262c34fbc02f0c0e82e2da9e2b5a1f936d911255b499321cb31731272997
|
|
BLAKE2b-256 checksum How to use checksums |
60817e71808b7915e5129ac441a49aafdef912f91a68bc5cf6ee39b000eab133
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Nov 2, 2026.
Transparency logRelease files / cellgraph-0.2.0-py3-none-any.whl
| Download URL | cellgraph-0.2.0-py3-none-any.whl |
|---|---|
| Size | 40.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42e73fc149b37f18f4de694858db12cbd372a11861eeb51fdde6a2f34742d430
|
|
BLAKE2b-256 checksum How to use checksums |
7e8a76b1d2591cc9232fded4a0fbb776a8087866a0b3df0a97e00b845b534080
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Nov 2, 2026.
Transparency logSecurity for cellgraph 0.2.0
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 cellgraph-0.2.0.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 Nov 2, 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.