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")

Build a living spec with interactive suggest: describe a requirement, drag and rate diagrams, then apply the accepted rules. Add or revise requirements in the same notebook view; future diagram calls use the updated spec. print(spec) shows which prompts produced each rule. For a one-shot editable draft, use suggest_draft.

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.15.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 spytial-diagramming 1.15.0
File Size Uploaded Provenance Actions
spytial_diagramming-1.15.0.tar.gz 1.9 MB Without provenance Details for spytial_diagramming-1.15.0.tar.gz

Built distribution (wheel)

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

Total release size: 3.6 MB

Release files / spytial_diagramming-1.15.0.tar.gz

Download URL spytial_diagramming-1.15.0.tar.gz
Size 1.9 MB
Tags Source
SHA-256 checksum
How to use checksums
8bcb814bf08daa943eff6f6115acc2441197e9108027777f2c68a34babc33123
BLAKE2b-256 checksum
How to use checksums
4493a559277e7482c7d0fad7fa2cf7616b5065aee5fe7312ef6483f665a04d5e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

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

Download URL spytial_diagramming-1.15.0-py3-none-any.whl
Size 1.7 MB
Tags Python 3
SHA-256 checksum
How to use checksums
847f263899d1d6875a78bfa7c90d3bbc062ec067b132ba5cb128b2e97cf7d7cb
BLAKE2b-256 checksum
How to use checksums
f9e87f072643ed4f29f9177d5bae8482bd9a00835d5c5b6eac13f2b876f6537a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.16

Security for spytial-diagramming 1.15.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.

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