skillfed

simpy

Event discrete, process based simulation for Python.

simpy v4.1.2 527.1K downloads/30d#6,171 on PyPI
Permissive license MIT Active released

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 simpy

uv

uv add simpy

poetry

poetry add simpy

Installing 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

Development Status :: 5 - Production/StableEnvironment :: ConsoleIntended Audience :: DevelopersIntended Audience :: EducationIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseNatural Language :: EnglishOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.13Programming Language :: Python :: 3.14Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Programming Language :: Python :: Implementation :: CPythonProgramming Language :: Python :: Implementation :: PyPyTopic :: Scientific/Engineering

Tags

discrete event simulation pythonprocess-based simulation frameworkevent-driven simulationagent-based modeling pythonresource congestion modelingsimulation with generatorsreal-time simulation framework
simulationdiscrete-eventmodeling

More Scientific/Engineering packages