Skip to main content

Discrete event simulation library for Python.

Project description

Visuals autogenerated from examples/visual/chash_example.py

Happy Simulator

A simulation library built for the modern world.

PyPI Tests Docs Ask DeepWiki License

Documentation · Examples · Blog Post


[!WARNING] Alpha — Still in active development. Some features may not work as expected. Interfaces may change drastically.

Happy Simulator is a code-first simulation library for education, research, design, or entertainment.

Some articles using the library:

Features

  • Intuitive modeling — convert real-world components into simulated equivalents.
  • Rich component library — queues, load balancers, rate limiters, industrial components, behavioural models and more
  • Visual debugger — browser-based UI generated from simulation model.
  • AI Compatible - use your generative AI of choice to convert scenarios to simulations.

Quick Start

pip install happysim
from happysimulator import Simulation, Source, Sink, Server, Instant
from happysimulator.distributions import ExponentialLatency

sink = Sink()
server = Server("Server", service_time=ExponentialLatency(0.1), downstream=sink)
source = Source.poisson(rate=8, target=server)

sim = Simulation(sources=[source], entities=[server, sink], end_time=Instant.from_seconds(60))
summary = sim.run()

Visual Debugger

pip install happysim[visual]
# define sim
from happysimulator.visual import serve
serve(sim)  # opens browser at http://127.0.0.1:8765

Step through events, inspect entity state, and create interactive dashboards from the browser.

Installation

pip install happysim              # core library
pip install happysim[visual]      # + browser debugger (FastAPI + uvicorn)
pip install happysim[dev]         # + testing & docs tools

Or install from source:

git clone https://github.com/adamfilli/happy-simulator.git
cd happy-simulator
pip install -e ".[dev]"

Documentation

Full guides, API reference, and example walkthroughs at adamfilli.github.io/happy-simulator.

License

Apache 2.0

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

happysim-0.2.4.tar.gz (392.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

happysim-0.2.4-py3-none-any.whl (546.1 kB view details)

Uploaded Python 3

File details

Details for the file happysim-0.2.4.tar.gz.

File metadata

  • Download URL: happysim-0.2.4.tar.gz
  • Upload date:
  • Size: 392.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for happysim-0.2.4.tar.gz
Algorithm Hash digest
SHA256 9aa80ddac3753a2ed1ee530b29a9c9fb970e89d1deb3fa53460967984bc06449
MD5 244cb454d2e16dddea68529f5c4d7db2
BLAKE2b-256 2da7f2bfa3892f62d40545811fbf53e69b47ac62f3c5ef352f3c3b3b7eee26f8

See more details on using hashes here.

Provenance

The following attestation bundles were made for happysim-0.2.4.tar.gz:

Publisher: publish-pypi.yml on adamfilli/happy-simulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file happysim-0.2.4-py3-none-any.whl.

File metadata

  • Download URL: happysim-0.2.4-py3-none-any.whl
  • Upload date:
  • Size: 546.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for happysim-0.2.4-py3-none-any.whl
Algorithm Hash digest
SHA256 06754a862a7d0973e820aeeb571b0c911b0e7e0678353e46485dcaf8bda847c4
MD5 06579420343e6bb092180ce7ac9ae3c9
BLAKE2b-256 c756452de26a280f2bb3ba86253c119757e05d9018f7ced7951a3492d7f1b5de

See more details on using hashes here.

Provenance

The following attestation bundles were made for happysim-0.2.4-py3-none-any.whl:

Publisher: publish-pypi.yml on adamfilli/happy-simulator

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page