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 for distributed systems.

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.5.tar.gz (999.2 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.5-py3-none-any.whl (1.2 MB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for happysim-0.2.5.tar.gz
Algorithm Hash digest
SHA256 86ae78c1e9db7700850a4b4c9247ba31c46ffe5ce1fdeb382149c054fb263537
MD5 d29c2012e6ce7d19274107cbebe41103
BLAKE2b-256 2b897688ca7cef4cc79f67cfb7dd1fe14cbb3d523ea27a245ddc2f69a217559c

See more details on using hashes here.

Provenance

The following attestation bundles were made for happysim-0.2.5.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.5-py3-none-any.whl.

File metadata

  • Download URL: happysim-0.2.5-py3-none-any.whl
  • Upload date:
  • Size: 1.2 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for happysim-0.2.5-py3-none-any.whl
Algorithm Hash digest
SHA256 0d38ba75252c9442766a275ab60d4f6e0d4aa766ef7c156216a6aa7b703f69df
MD5 30500dcc2a158824cc4a2dbd16d6fff2
BLAKE2b-256 9dba695045db6fb481e156120598050bfacf535c38f75c591f215e4684e950d7

See more details on using hashes here.

Provenance

The following attestation bundles were made for happysim-0.2.5-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