Skip to main content

sPyTial: Lightweight Diagrams for Structured Python Data

PyPI version Python versions License: MIT CI Docs

pip install spytial-diagramming

Docs: https://sidprasad.github.io/spytial/ — start with Getting Started for install, badges, and your first diagram.


Sometimes you just want to see your data.

You're working with a tree, a graph, a recursive object — maybe an AST, a neural network, or a symbolic term. You don't need an interactive dashboard or a production-grade visualization system. You just need a diagram that lays it out clearly so you can understand what's going on.

That's what sPyTial is for. It is designed for developers, educators, and researchers who work with structured data and need to make that structure visible — to themselves or to others — with minimal effort.

Why spatial layout

Spatial arrangement helps people understand structure: when elements are grouped, aligned, and oriented meaningfully, patterns and errors become easier to see. sPyTial gives you that layout by default — the diagram reflects how the parts are connected, not how they happen to be stored.

You get:

  • a box-and-arrow diagram that shows the shape of your data
  • a layout driven by declarative constraints (orientation, align, cyclic, group)
  • a tool that flags when a constraint can't be satisfied

Quick start

import spytial

data = {
    "name": "root",
    "children": [
        {"value": 1},
        {"value": 2},
        {"value": 3},
    ],
}

# Opens in a browser tab, or inline in a Jupyter notebook.
spytial.diagram(data)

# Or save to a file:
spytial.diagram(data, method="file")

Not sure where to start with a class of your own? from spytial.suggest import suggest then suggest(MyClass) reads the class and scaffolds a starting set of layout directives you can edit — see Suggesting Specs.

For stepping through sequences of states, custom relationalizers, and annotation-driven layouts, see the docs.

  • spytial-clrs — a Jupyter notebook collection that implements the data structures from the CLRS algorithms textbook (Cormen, Leiserson, Rivest, Stein) using sPyTial: heaps, linked lists, hash tables, BST / red-black / B / van Emde Boas trees, disjoint-set forests, graphs with MST and SCC views, and more. The best place to see sPyTial on realistic structures.
  • spytial-core — the browser-side rendering engine sPyTial uses under the hood. Shared across all sPyTial language hosts (Python, Rust, Pyret, Lean).

License

MIT — see LICENSE.

Browser assets and offline use

The Python package includes its pinned spytial-core browser JS and CSS. Normal diagram(..., method="browser") and method="file" outputs are self-contained; edit() serves these assets through its existing local server. The evaluator, sequence viewer, and standalone editor follow the same delivery policy.

Notebook output and the Pyodide playground use pinned CDN URLs by default, keeping saved notebook cells small. Set SPYTIAL_ASSETS=embedded for offline notebook use, or SPYTIAL_ASSETS=cdn to opt into CDN delivery for every output. The default is SPYTIAL_ASSETS=auto. Explicit file exports embed the assets even under Pyodide. For example, before generating a notebook output:

import os
os.environ["SPYTIAL_ASSETS"] = "embedded"

Embedded output includes several megabytes of JavaScript per page; saved notebook outputs use isolated srcdoc iframes to avoid data-URL size limits. CDN output requires network access on a cold load. Vendoring removes that network dependency for local output, but each new page still initializes JavaScript and computes its layout. Offline pages use locally available fonts instead of requesting the default Google Font. Explicit remote resources in your own spec (such as image URLs) still need a connection.

Maintainers: run ./update-spytial-core.sh to update all vendored core assets, or ./update-spytial-core.sh --version 6.6.0 to select or repair an exact release. ./update-spytial-core.sh --check verifies hashes and the complete file inventory offline. See the vendoring instructions for offline tarballs and wheel verification.

Metadata

Release files for spytial-diagramming 1.14.3

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

Source distribution (sdist)

Source distribution for spytial-diagramming 1.14.3
File Size Uploaded Provenance Actions
spytial_diagramming-1.14.3.tar.gz 1.6 MB Without provenance Details for spytial_diagramming-1.14.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for spytial-diagramming 1.14.3
File Interpreter ABI Platform Actions
spytial_diagramming-1.14.3-py3-none-any.whl Python 3 none any Details for spytial_diagramming-1.14.3-py3-none-any.whl

Total release size: 3.0 MB

Release files / spytial_diagramming-1.14.3.tar.gz

Download URL spytial_diagramming-1.14.3.tar.gz
Size 1.6 MB
Tags Source
SHA-256 checksum
How to use checksums
7d761cedd0377b6751fb72ef1637aacded9a7b7282d9c6cf72e7d3c01a608c33
BLAKE2b-256 checksum
How to use checksums
29d9d92a8d9ab0b5f579804be71db946daae719e98fb05d6f409f4efdf1a0d4a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Release files / spytial_diagramming-1.14.3-py3-none-any.whl

Download URL spytial_diagramming-1.14.3-py3-none-any.whl
Size 1.4 MB
Tags Python 3
SHA-256 checksum
How to use checksums
b190b33fef30e12f98eaf8e25d33a682f1e80ed6d1cd25e29b89c7d9258b66c9
BLAKE2b-256 checksum
How to use checksums
04f9160ab4c8ea4b636614d927b60615b1073d492e2fc800cdbe350e6469f683
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.14

Security for spytial-diagramming 1.14.3

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.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A 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.

Release history Release notifications | RSS feed

This release

1.14.3 This release

2 release files No provenance

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