Skip to main content

Vertep

vertep

W3C SCXML statecharts as journaled actors, from Python

PyPI GitHub license

Vertep runs W3C SCXML statecharts as event-sourced actors. This package is the Python binding of the same Rust core that backs the Rust crates and the @vertep/web npm package: one chart, one journal format and one set of semantics in all three.

  • Charts in SCXML, YAML or RDF, validated and content-addressed exactly as in the Rust runtime
  • One journal entry per accepted event, with the transitions it took; time travel with as_of
  • Durable timers, and a journal in a file that the Rust runtime and @vertep/web open as well
  • The state graph queryable with SPARQL
  • Guards and actions written in Python, and the CEL datamodel built in
  • An explicit clock: real time for services, a virtual clock for deterministic tests

Install

pip install vertep

CPython 3.9 or later. Wheels for Linux, macOS and Windows; no Rust toolchain needed.

Use

from vertep import ActorSystem

CART = """<scxml xmlns="http://www.w3.org/2005/07/scxml" version="1.0"
       datamodel="cel" name="cart" initial="empty">
  <datamodel><data id="items" expr="0"/></datamodel>
  <state id="empty">
    <transition event="add" target="filled"><assign location="items" expr="ctx.items + ev.data.qty"/></transition>
  </state>
  <state id="filled">
    <transition event="add"><assign location="items" expr="ctx.items + ev.data.qty"/></transition>
    <transition event="checkout" cond="ctx.items > 0" target="ordered"/>
  </state>
  <state id="ordered"/>
</scxml>"""

with ActorSystem(storage="memory", clock="virtual") as system:
    # A virtual actor is addressed by chart type and key; the first message activates it.
    cart = system.spawn(CART, type="https://example.org/charts/cart", key="alice")

    cart.subscribe(lambda s: print(s.position, s.configuration, s.context))

    cart.send("add", qty=2)       # an event is its name plus payload fields
    cart.send("add", qty=1)
    cart.send("checkout")

    print(cart.snapshot().matches("ordered"))   # True
    print(cart.as_of(position=1).context)       # {'items': 2.0}: the state after entry 1
    for entry in cart.journal():                # every event, with the transitions it took
        print(entry["position"], entry["event"]["name"])

A durable actor keeps its journal in a file and survives a restart, including timers that fell due while it was away:

with ActorSystem(storage="file", path="orders.db") as system:
    order = system.spawn(ORDER, type="https://example.org/charts/order", key="42")
    order.send("pay")             # schedules `ship` in 200 ms, durably
    system.wait(0.5)              # real time passes; the timer fires

An auditor checks an agent's explanation bundle (exported by a Rust agent host) offline, with no actor system or decider:

import vertep
v = vertep.verify_bundle(open("review-bundle.json").read())  # raises BundleInvalid if tampered
for x in v.explanations:
    print(x["position"], x["state_before"], "->", x["state_after"])

More in the repository: examples/python (a quick start, a cart, a durable actor, Python guards and actions) and the documentation.

Things to know

  • A system belongs to the thread that created it, and the API is synchronous (no asyncio yet).
  • CEL integers arrive as Python floats, as they do in JavaScript.
  • Not yet bound: request/reply, the WebSocket transport, agent hosts (only bundle verification is), federation and the cluster. Use the Rust crates for those.

License

MIT or Apache-2.0, at your option.

Metadata

Release files for vertep 0.1.13

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

Source distribution (sdist)

Source distribution for vertep 0.1.13
File Size Uploaded Provenance Actions
vertep-0.1.13.tar.gz 1.1 MB With provenance Details for vertep-0.1.13.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for vertep 0.1.13
File Actions
vertep-0.1.13-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for vertep-0.1.13-cp39-abi3-win_amd64.whl
vertep-0.1.13-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.9 abi3 Linux glibc 2.17+ x86-64 Details for vertep-0.1.13-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
vertep-0.1.13-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for vertep-0.1.13-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
vertep-0.1.13-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for vertep-0.1.13-cp39-abi3-macosx_11_0_arm64.whl
vertep-0.1.13-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for vertep-0.1.13-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 38.7 MB

Release files / vertep-0.1.13.tar.gz

Download URL vertep-0.1.13.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
5f0c959c978df3d8d358fea3d6ff1b0b04e34fe57ed29b82b14390fcc7b86b2c
BLAKE2b-256 checksum
How to use checksums
848247f66d6e3e0757bbf0d047bf4a071d53681c01eee780c5d3d61be47b3cf4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 17, 2026.

Transparency log

Release files / vertep-0.1.13-cp39-abi3-win_amd64.whl

Download URL vertep-0.1.13-cp39-abi3-win_amd64.whl
Size 7.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0876fe6707b0ac40263350a84077a100662736bbca4ca3f1bb54748318493a20
BLAKE2b-256 checksum
How to use checksums
6097245b73d6860235d1fadff59ea81e2544f62c03a934fe0d63bac985165286
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 17, 2026.

Transparency log

Release files / vertep-0.1.13-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL vertep-0.1.13-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 8.0 MB
Tags CPython 3.9 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
79dd01ab91a723b3bc81e3491886d0713391b670b0d2aa3fe458dfc136f532c7
BLAKE2b-256 checksum
How to use checksums
2456c95610ca53404bb89cd7d5947888eafde055c7e2b6ea7767ee99c6220881
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 17, 2026.

Transparency log

Release files / vertep-0.1.13-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL vertep-0.1.13-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 7.7 MB
Tags CPython 3.9 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
2faf17cbf27c2dbe728820ec7e37185ffcb10a6f808e4a6b0aa5a2d2853f58db
BLAKE2b-256 checksum
How to use checksums
ffd2a01876d6c14c29b0cbbaa1042e7eb12e945277f9f87578b37566ea05a203
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 17, 2026.

Transparency log

Release files / vertep-0.1.13-cp39-abi3-macosx_11_0_arm64.whl

Download URL vertep-0.1.13-cp39-abi3-macosx_11_0_arm64.whl
Size 7.2 MB
Tags CPython 3.9 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
d1097704100537135236fe01671318847725562f742e5b40a3f95026aca27ef9
BLAKE2b-256 checksum
How to use checksums
f34b26af1d7553b509d096fc5fac61b67ff6bc45f378467c27b77886d97b34dd
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 17, 2026.

Transparency log

Release files / vertep-0.1.13-cp39-abi3-macosx_10_12_x86_64.whl

Download URL vertep-0.1.13-cp39-abi3-macosx_10_12_x86_64.whl
Size 7.5 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
f06e99b0c1310fcbbb8cb5201076ab8c0b227946742b6e106d699fcd1665febb
BLAKE2b-256 checksum
How to use checksums
5b1cd5ca768e6997878afb141315e6cd41d021a536f06f6ade984a39e37a24fc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 17, 2026.

Transparency log

Security for vertep 0.1.13

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

All 6 files in this release have been uploaded with provenance metadata.

Select from 6 files

Attestation for vertep-0.1.13.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 17, 2026.

Transparency log

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.

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