Pied Piper
An Agent-Based Model Framework for Simulating Societal Resilience
Illustration by Kate Greenaway for Robert Browning's "The Pied Piper of Hamelin"
Introduction
Living beings exist in perpetual tension with their environment, continually adapting to changes in their surroundings. This project aims to model the interdependent nature of life between humans and their environment.
Documentation
Full documentation, including installation instructions, usage guides, API reference, examples, and contributor guidelines, is available at: PiperABM Documentation
Installation
Install the package using pip:
pip install piperabm
For advanced installation options, including animation support, see the Installation guide.
Usage
Once a Model instance is created, it automatically includes interconnected infrastructure and society components. The simulation is designed to explore how changes in one domain, such as agent behavior or infrastructure layout, affect the other over time. This interdependence forms the core of agent-based modeling within PiperABM.
import piperabm as pa
model = pa.Model()
model.infrastructure.add_street(pos_1=[0, 0], pos_2=[-60, 40], name='road')
model.infrastructure.add_home(pos=[5, 0], id=1, name='home 1')
model.infrastructure.add_home(pos=[-60, 40], id=1, name='home 2')
model.infrastructure.bake()
model.society.generate(num=2, gini_index=0.4, average_balance=1000)
model.run(n=100, step_size=60)
For a guided walkthrough, see the step-by-step usage guide, and for additional examples, refer to the examples folder in the repository.
Supported Python Versions
It has been tested and verified to work with Python versions 3.11 to 3.13. While it is expected to work with older versions of Python (given compatible dependency versions), these environments have not been tested and are not officially supported.
Contributing
Contributions are welcome, including bug fixes, documentation improvements, and extensions to existing model components.
Please see the full contributor guide in the documentation: Contributing Guide
This guide explains:
- Where to make changes in the codebase
- How tests are organized and run
- How to build the documentation locally
License
Distributed under the MIT License. See LICENSE.txt for more information.
Release files for piperabm 0.2.3
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| piperabm-0.2.3.tar.gz | 63.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| piperabm-0.2.3-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 169.1 kB
Release files / piperabm-0.2.3.tar.gz
| Download URL | piperabm-0.2.3.tar.gz |
|---|---|
| Size | 63.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e182c02d213c4886389a069d127fd0f6f2c910daabb6bbe0cd3955a86c34272d
|
|
BLAKE2b-256 checksum How to use checksums |
0c1bd9071f68469f0018659d8d6028216443b4b74c6da2120c068e1399be8c9a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.
Transparency logRelease files / piperabm-0.2.3-py3-none-any.whl
| Download URL | piperabm-0.2.3-py3-none-any.whl |
|---|---|
| Size | 105.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
d524af1b9bd94e8727f7be759eb52e88a73be59436143a520f502bea5dbf1d1c
|
|
BLAKE2b-256 checksum How to use checksums |
ba7cc6f06dbecb1b4be8358a44a2b5bdb218f5a965c23616e2940005239eb5ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.12
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Apr 12, 2026.
Transparency log