simpy
Event discrete, process based simulation for Python.
What it is and what it does
SimPy is a discrete-event simulation framework built on standard Python that lets you model systems as processes defined by generator functions. You define active components (customers, vehicles, agents) and shared resources (servers, counters, tunnels) and then run the simulation to observe how the system behaves over time. The framework handles the event scheduling and process coordination for you.
It's designed for scenarios where you want to understand system behavior through simulation—how queues form, how resources get congested, how timing affects outcomes. You can run simulations as fast as the computer allows, synchronized to wall-clock time, or step through events manually for debugging. The framework is not suited for continuous simulations or fixed-step models where processes don't interact.
Use it for:
- Model customer flows through a bank or retail checkout to understand queue lengths and service times.
- Simulate vehicle routing and congestion in a transportation network to optimize dispatch.
- Test agent-based models where multiple autonomous entities interact with shared resources.
- Prototype manufacturing or production systems to find bottlenecks before building.
- Evaluate IT infrastructure (server load, request queuing) under different traffic patterns.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
SimPy is a process-based discrete-event simulation framework that uses Python generator functions to model active components and shared resources, allowing simulations to run as fast as possible, in real time, or by manual stepping.
Yes. SimPy is a mature, actively maintained framework with zero dependencies, permissive licensing, and broad Python version support. It solves a specific, well-defined problem—discrete-event simulation—and does so with a clean, Pythonic API. Install it if you need to model systems with interacting processes and shared resources; skip it if your problem is continuous simulation or fixed-step modeling.
Install
simpy on PyPI
pip
pip install simpyuv
uv add simpypoetry
poetry add simpyInstalling simpy
Before you install
Low friction: pure Python wheel with no runtime dependencies, requires Python >= 3.8, and actively maintained with a recent release.
License in practice
MIT license is permissive; you can use, modify, and distribute SimPy with minimal restrictions, making it suitable for both open-source and commercial projects.
Quickstart
pip install simpy
import simpy
def clock(env, name, tick):
while True:
print(name, env.now)
yield env.timeout(tick)
env = simpy.Environment()
env.process(clock(env, 'fast', 0.5))
env.run(until=2)
Requires Python >= 3.8; not designed for continuous simulations or fixed-step simulations where processes don't interact.
Verify before relying
- Performance characteristics and scalability limits for large-scale simulations.
- Whether the package supports parallel or distributed simulation execution.
- Typical use-case performance benchmarks compared to other discrete-event simulators.
Package facts
| License | MIT (permissive) |
| Python support | supports the current Python release (>=3.8) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 82 days since the last release |
| First released | |
| Downloads | 527,054/month — #6,171 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: simpy-4.1.2-py3-none-any.whl
Tags
More Scientific/Engineering packages
NumPy provides an N-dimensional array object…
permissive · top 100 on PyPI
pandaspandas provides fast, flexible data structures…
permissive · top 100 on PyPI
scipyscipy provides numerical algorithms for…
permissive · top 100 on PyPI
scikit-learnscikit-learn provides a comprehensive Python…
permissive · top 1,000 on PyPI
dilldill extends Python's pickle module to…
permissive · top 1,000 on PyPI
multiprocessMultiprocess is an enhanced fork of Python's…
permissive · top 1,000 on PyPI
salabimSalabim is a Python library for discrete event…
permissive · top 15,000 on PyPI
bpyExposes Blender's 3D creation suite—modeling,…
copyleft · top 15,000 on PyPI
pybammPyBaMM is a Python framework for simulating…
permissive · top 15,000 on PyPI
warp-langWarp is a Python framework that JIT-compiles…
permissive · top 5,000 on PyPI
matscipyMatscipy provides domain-specific computational…
copyleft · top 15,000 on PyPI
aseASE provides Python tools for setting up,…
copyleft · top 5,000 on PyPI
pvlibSimulates photovoltaic energy system…
permissive · top 5,000 on PyPI
OpenMMOpenMM is a Python wrapper for a C++ molecular…
permissive · top 15,000 on PyPI