SimPyLens: zero-invasion visualization and debugging toolkit for SimPy simulations
Project description
SimpyLens: Simpy Visualization and Debugging Toolkit
SimpyLens is a low-intrusion toolkit for SimPy model visualization, debugging, and runtime inspection. It helps developers understand queueing behavior, resource contention, and process flow in real time without rewriting simulation business logic.
SimPy Visual Demos
Full Simulation Debugging Workflow
assets/pottery_factory.gif shows the full SimpyLens interface for discrete-event simulation debugging: runtime controls, process flow, resource movement, and live inspection.
It is useful for users searching for a SimPy visual debugger, queueing simulation viewer, or simulation runtime inspection tool.
Manual Resource Layout for Process Storytelling
assets/manual_layout.gif demonstrates manual resource positioning so teams can present and analyze process flow with a clearer mental model.
This is especially relevant for simulation demos, teaching, and operations reviews where layout readability matters.
Key Features
- Real-time visualization for SimPy resources and process interactions.
- Runtime controls for play, step, pause, reset, and speed.
- Breakpoints with expression/callable conditions and edge modes.
- Structured logs for simulation, step lifecycle, resources, and breakpoints.
- Headless mode for tests and CI.
- Optional metrics collection with read-only resource metrics.
Installation
pip install simpylens
Quickstart
import simpy
import simpylens
def model(env):
server = simpy.Resource(env, capacity=1)
def customer():
with server.request() as req:
yield req
yield env.timeout(3)
env.process(customer())
lens = simpylens.Lens(model=model, gui=True, seed=42)
lens.show()
SimPy Examples Included
Examples are in examples/ and grouped by origin.
Adapted from official simpy examples/tutorial lineage:
examples/bank_renege.pyexamples/gas_station_refueling.py
Original SimpyLens examples:
examples/pottery_factory.pyexamples/wafer_fabrication.py
FAQ
Is SimpyLens a SimPy debugger?
Yes. SimpyLens provides breakpoint-based debugging, structured event logs, and step-by-step runtime inspection for SimPy simulations.
Can I visualize SimPy resources in real time?
Yes. SimpyLens visualizes Resource, Container, and Store families, including queue/load behavior and process flow.
Can SimpyLens run in headless mode for automated testing?
Yes. Use Lens(gui=False) to run simulations and assertions in tests or CI pipelines.
Does SimpyLens require rewriting my simulation model?
No. SimpyLens is designed for low-intrusion integration with your existing SimPy setup function.
Contributing
Contributions are welcome.
Suggested workflow:
- Fork the repository.
- Create a feature branch.
- Add or update tests and examples.
- Submit a pull request with a clear change description.
Documentation
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file simpylens-0.1.6.tar.gz.
File metadata
- Download URL: simpylens-0.1.6.tar.gz
- Upload date:
- Size: 138.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
fe87f02571010a4d64a7fd592682def26cb6731280799bde1a6eea7ce479423a
|
|
| MD5 |
5a4c247536d3b1e40a9eee6a95f9c552
|
|
| BLAKE2b-256 |
45d4bede5f1db3542ea054cc15c49af01afae9774b9067c0e9411d3c095ef5ae
|
Provenance
The following attestation bundles were made for simpylens-0.1.6.tar.gz:
Publisher:
publish-pypi.yml on samuelc254/SimpyLens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simpylens-0.1.6.tar.gz -
Subject digest:
fe87f02571010a4d64a7fd592682def26cb6731280799bde1a6eea7ce479423a - Sigstore transparency entry: 1094255648
- Sigstore integration time:
-
Permalink:
samuelc254/SimpyLens@c764d9961aefe0df15f56afdfd2ad3d944122ad5 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/samuelc254
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c764d9961aefe0df15f56afdfd2ad3d944122ad5 -
Trigger Event:
push
-
Statement type:
File details
Details for the file simpylens-0.1.6-py3-none-any.whl.
File metadata
- Download URL: simpylens-0.1.6-py3-none-any.whl
- Upload date:
- Size: 131.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
92efd74d4f5556a1b93a908584162b667df270c559d9c7c32b8d55a9af2a1914
|
|
| MD5 |
c64ebce38f6b279d820a4bbd8f73813b
|
|
| BLAKE2b-256 |
b62df0772f2396360fb194b16befc09d80e53d6c1b167796365bcb295b993e98
|
Provenance
The following attestation bundles were made for simpylens-0.1.6-py3-none-any.whl:
Publisher:
publish-pypi.yml on samuelc254/SimpyLens
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
simpylens-0.1.6-py3-none-any.whl -
Subject digest:
92efd74d4f5556a1b93a908584162b667df270c559d9c7c32b8d55a9af2a1914 - Sigstore transparency entry: 1094255680
- Sigstore integration time:
-
Permalink:
samuelc254/SimpyLens@c764d9961aefe0df15f56afdfd2ad3d944122ad5 -
Branch / Tag:
refs/tags/v0.1.6 - Owner: https://github.com/samuelc254
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@c764d9961aefe0df15f56afdfd2ad3d944122ad5 -
Trigger Event:
push
-
Statement type: