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

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.14
File Size Uploaded Provenance Actions
vertep-0.1.14.tar.gz 1.1 MB With provenance Details for vertep-0.1.14.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for vertep 0.1.14
File Actions
vertep-0.1.14-cp39-abi3-win_amd64.whl CPython 3.9 abi3 Windows x86-64 Details for vertep-0.1.14-cp39-abi3-win_amd64.whl
vertep-0.1.14-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.14-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
vertep-0.1.14-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.9 abi3 Linux glibc 2.17+ ARM64 Details for vertep-0.1.14-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
vertep-0.1.14-cp39-abi3-macosx_11_0_arm64.whl CPython 3.9 abi3 macOS 11.0+ ARM64 Details for vertep-0.1.14-cp39-abi3-macosx_11_0_arm64.whl
vertep-0.1.14-cp39-abi3-macosx_10_12_x86_64.whl CPython 3.9 abi3 macOS 10.12+ x86-64 Details for vertep-0.1.14-cp39-abi3-macosx_10_12_x86_64.whl

Total release size: 38.7 MB

Release files / vertep-0.1.14.tar.gz

Download URL vertep-0.1.14.tar.gz
Size 1.1 MB
Tags Source
SHA-256 checksum
How to use checksums
14297312dc38fcb2f4eb43f7fbbc0b6d2cf5f87a6211c85643fb8d210d853d18
BLAKE2b-256 checksum
How to use checksums
a64be3ff631f48445247684f7bf6a268bc6c26e776331badb25426dece1a48a7
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.14-cp39-abi3-win_amd64.whl

Download URL vertep-0.1.14-cp39-abi3-win_amd64.whl
Size 7.2 MB
Tags CPython 3.9 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
c3188787d3a726f83e86b9897a246f9e35432343c727e6ab5e52bac46fc2e0c9
BLAKE2b-256 checksum
How to use checksums
ebab6c7c1ce28aa9af174ae1abde84e96c5f5ec679b8ade983b4b62f3e1180bb
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.14-cp39-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL vertep-0.1.14-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
4a8bbd042fed8890b1768f7f401dcea58e7f6cecd475db17a4587c3fd38f2878
BLAKE2b-256 checksum
How to use checksums
3173d7b51c8b8135fcb9e2886443cda45ca380e4c7bf9e40b6ef98be4fd7aeba
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.14-cp39-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL vertep-0.1.14-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
7aa4a3b659a852caeb74256a1ca495b67d3884ff12b6e9dc6e34e3afa6ddcf84
BLAKE2b-256 checksum
How to use checksums
7ab063b5d074f777a35dceef29f89cd2938d52b1f6e6d12b449f1b92993c11ed
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.14-cp39-abi3-macosx_11_0_arm64.whl

Download URL vertep-0.1.14-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
96771941a96efef30bfaee2a89c51d9cf9c6be0193800e412d14a999108ac2a8
BLAKE2b-256 checksum
How to use checksums
5574c06f6d9134de80f2befffa27914afaf5921317f8c3b2d821b713944fc4eb
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.14-cp39-abi3-macosx_10_12_x86_64.whl

Download URL vertep-0.1.14-cp39-abi3-macosx_10_12_x86_64.whl
Size 7.6 MB
Tags CPython 3.9 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
cbd9c1f5bdffc9bf8c8d4215e39f20c576e9cae11a349566a404b9e51b3c3bd5
BLAKE2b-256 checksum
How to use checksums
6dc9d00cae018ded16fa6af172b5732b3ab61d56aaacf896f2516028ff11676c
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.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.

Full provenance

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

Select from 6 files

Attestation for vertep-0.1.14.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