Skip to main content

Durable Actors for Python

Durable actors and typed clients, backed by the Rust runtime.

Quickstart · Reference · Runnable example

Quickstart

Requires Python 3.11+ and uv. The CLI, SDK, and native runtime are installed as Python packages.

Create a project anywhere. uv installs the SDK, CLI, and matching native runtime wheel from PyPI.

uvx --from 'durable-actors[cli]' durable-actors init my-actors
cd my-actors

Define src/actors.py. Every instance field must use persisted() or ephemeral(). Persisted fields are stored in SQLite, which the Rust runtime owns and replicates with Litestream; local development persists to the filesystem. Wrap persisted fields with emitted() to broadcast saved changes.

from durable_actors import Actor, emitted, persisted

class Counter(Actor):
    count: int = emitted(persisted(0))

    def increment(self, amount: int = 1) -> int:
        self.count += amount
        return self.count
uv run durable-actors dev

Call an actor

In another terminal in the same directory, generate the client:

uv run durable-actors generate

Save as client.py and run uv run client.py:

from generated import actors

counter = actors.Counter.get("one")
print(counter.increment())

Async actors and clients

Define AsyncActor methods and socket hooks with async def. Calls stay serialized across await unless marked @interleave. Generated async_actors clients work with either actor style:

from durable_actors import AsyncClient
from generated import async_actors

async with AsyncClient() as client:
    print(await async_actors.Counter.get("one", client).increment())

Await actor database and connection queries, and broadcast(); socket handle methods remain synchronous. Reuse AsyncClient for connection pooling. Close async connections and subscriptions with async with or aclose().

Use the client in another application

Copy the entire generated package, including its helper modules, into the application. From that application's root, install the client runtime:

uv add durable-actors

This installs the runtime dependencies automatically. The [codegen] extras are only needed to generate or regenerate clients, not to run them.

Subscribe to state

Callbacks receive complete typed snapshots on a background thread. Keep the process running while listening; the context manager closes the subscription.

from generated import actors

counter = actors.Counter.get("one")
with counter.subscribe(lambda state: print(state.count), on_error=print):
    counter.increment()
    input("Press Enter to stop.\n")

Metadata

Release files for durable-actors 0.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 durable-actors 0.14.3
File Size Uploaded Provenance Actions
durable_actors-0.14.3.tar.gz 162.3 kB With provenance Details for durable_actors-0.14.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for durable-actors 0.14.3
File Interpreter ABI Platform Actions
durable_actors-0.14.3-py3-none-any.whl Python 3 none any Details for durable_actors-0.14.3-py3-none-any.whl

Total release size: 235.6 kB

Release files / durable_actors-0.14.3.tar.gz

Download URL durable_actors-0.14.3.tar.gz
Size 162.3 kB
Tags Source
SHA-256 checksum
How to use checksums
f50e340714b6a43e303212494717043a477055e6075ea1268987da409892ae0c
BLAKE2b-256 checksum
How to use checksums
3da98162367331dced44137202d6578f78f6a0d2d06c81aa064adc857ed19a67
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 Oct 29, 2026.

Transparency log

Release files / durable_actors-0.14.3-py3-none-any.whl

Download URL durable_actors-0.14.3-py3-none-any.whl
Size 73.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bfae62615d04e9d9a89225d19bc6fbd7763f329c4b39a5ef04c56629f5099b0b
BLAKE2b-256 checksum
How to use checksums
622efe921936aaa0e71520bf2561f78ce6bd1c7b32db57668e2a790cd75de110
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 Oct 29, 2026.

Transparency log

Security for durable-actors 0.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.

Full provenance

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

Select from 2 files

Attestation for durable_actors-0.14.3.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 Oct 29, 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.

Release history Release notifications | RSS feed

This release

0.14.3 This release

2 release files Full 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