Spark
An easy to use actor model framework in Python
What it is and what it does
Spark is an async actor framework that abstracts concurrent work into independent actors that communicate by message passing. You define actors by subclassing `Actor` and implementing `process()`, then create and manage them through a `Syndicate` instance. The core API is minimal: `tell()` for asynchronous fire-and-forget messages and `ask()` for request-reply with timeout. Actors can be organized hierarchically with parent-child relationships, supervision policies (restart, resume, escalate), and monitoring.
Beyond local concurrency, Spark offers opt-in distributed features: TCP routes with HMAC handshake, WebSocket routes for NAT traversal, authenticated federation for remote actor placement, and durable actors backed by SQLiteJournal. A separate `spark.workflow` package provides a higher-level abstraction for routing messages through a directed graph of processing nodes. The framework is in alpha (Development Status 3) and requires Python 3.13.
Use it for:
- Build concurrent services where independent tasks communicate via message passing instead of shared state.
- Create distributed systems with TCP or WebSocket routes connecting actor systems across network boundaries.
- Implement workflow pipelines using the `spark.workflow` layer to route messages through a sequence of processing nodes.
- Develop fault-tolerant systems with actor supervision, monitoring, and restart policies.
- Build NAT-traversal applications using the WebSocket relay for outbound-only connectivity.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Spark is an async-first actor framework for Python that lets you build concurrent and distributed systems by creating actors, sending messages with `tell()` (fire-and-forget) or `ask()` (request-reply), and managing them through a `Syndicate` instance.
Yes, if you are building a new concurrent or distributed system and are comfortable with alpha-stage software. The core API is clean, dependencies are minimal, and there are no known vulnerabilities. The project is actively maintained. Caution: verify that the supervision model and persistence layer meet your production requirements, and note that Python 3.13 is mandatory.
Install
spark on PyPI
pip
pip install sparkuv
uv add sparkpoetry
poetry add sparkInstalling Spark
Before you install
Installation is straightforward with no runtime dependencies for the core package. The project is actively maintained with a recent release and no known vulnerabilities. Optional extras like cbor2 and websocket are available for structured payloads and networking features.
License in practice
MIT license is permissive and imposes no significant restrictions on use, modification, or distribution in commercial or private projects.
Quickstart
pip install spark
from spark import Actor, Syndicate
from spark.core.message import Message
class Echo(Actor):
async def process(self, message: Message) -> str:
return f"echo:{message.content}"
async with Syndicate("app") as system:
echo = await system.create_actor(Echo)
print(await system.ask("hello", echo, timeout=1.0))
Requires Python 3.13 or later.
Verify before relying
- Whether the actor supervision model (restart/resume/escalate) is suitable for your fault-tolerance requirements.
- Performance characteristics and scalability limits for the number of actors and message throughput.
- Whether SQLiteJournal persistence is production-ready or still experimental.
- Maturity level of TCP and WebSocket remote routes for production deployments.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.13) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 90 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 80,523/month — #14,288 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: spark-0.4.1-py3-none-any.whl
Keywords: actor, concurrency, distributed, message-passing
Tags
More Python Modules packages
Converts domain names between Unicode and…
permissive · top 100 on PyPI
setuptoolsSetuptools is a Python build backend and…
permissive · top 100 on PyPI
PyYAMLPyYAML parses and emits YAML 1.1 data format,…
permissive · top 100 on PyPI
pydanticPydantic validates Python data structures…
permissive · top 100 on PyPI
annotated-typesProvides reusable metadata objects for use with…
permissive · top 100 on PyPI
typing-inspectionProvides runtime tools to inspect and…
permissive · top 100 on PyPI
pykkaPykka is a Python implementation of the actor…
permissive · top 15,000 on PyPI
thespianThespian provides an Actor Model framework for…
permissive · top 15,000 on PyPI
daprDapr SDK for Python provides client libraries…
permissive · top 15,000 on PyPI
apifyApify SDK for Python is the official framework…
permissive · top 15,000 on PyPI
signalwireSignalWire is a Python client library for…
permissive · top 15,000 on PyPI
raydpRayDP runs Apache Spark on Ray and integrates…
permissive · top 15,000 on PyPI
apify-clientA Python client library for the Apify REST API…
permissive · top 5,000 on PyPI
pyspark-clientPython client for connecting to Apache Spark…
permissive · top 5,000 on PyPI
pysparkPySpark provides Python bindings to Apache…
permissive · top 1,000 on PyPI
spark-sklearnDistributes scikit-learn model training and…
permissive · top 15,000 on PyPI