Python Automata Library (PAL)
PAL is a Python implementation of the Hybrid Automata Library (HAL), originally developed in Java and described in Bravo et al., PLOS Computational Biology (2020). PAL builds directly on HAL's modeling framework and design, providing high-performance agent-based, lattice population, and PDE modeling in Python. Model code uses a compact object-oriented API and can be compiled with @pal.njit; performance-sensitive state and algorithms run in a precompiled native core.
Installation and examples
Install PAL:
python -m pip install PythonAutomataLibrary
Copy the bundled examples and PDF/Markdown documentation to an editable PAL-Examples/ folder in your current directory:
python -m PythonAutomataLibrary.ExampleInstaller
Run an example script from PAL-Examples/. For a guided first model, see the PAL Guide.
Documentation
- PAL Guide (PDF) — first model, worked modeling workflows, and detailed API behavior.
- PAL Architecture and Design (PDF) — implementation structure, design rationale, subsystem choices, testing, and performance.
- API Reference (PDF) — source-derived public signatures.
- Cheatsheet (PDF) — compact one-page lookup for common operations.
Examples/— complete working models.- Testing — correctness, API, integration, and regression tests, with local and CI run instructions.
Features
import PythonAutomataLibrary as pal
PAL provides:
Grid: typed 1D/2D/3D lattice data.AgentGrid: lattice or continuous-position agents with identity and properties.PopGrid: integer lattice populations without individual agent identity.PDEgrid: diffusion/advection fields.IList: reusable integer query results.Multinomial: binomial/multinomial sampling.PixWindowandOpenGLWindow: 2D/3D visualization.@pal.njit: Numba compilation with PAL-specific source transformation and diagnostics.
PAL runs in safe mode by default. Call pal.FastMode() before constructing PAL objects to select the unchecked high-performance implementations after a model has been validated.
Installation details
PyPI wheels include the native core for Windows, Linux, and macOS, so manual compilation is unnecessary. The standard installation includes visualization dependencies. See PAL on PyPI and distribution details.
Advanced users who only need a minimal headless installation can skip declared dependencies and install the core requirements explicitly:
python -m pip install --no-deps PythonAutomataLibrary
python -m pip install numpy numba
Note that --no-deps skips all declared dependencies, not only visualization. As a result, pip check may report missing dependencies.
To install examples in a different parent directory, pass its path, such as python -m PythonAutomataLibrary.ExampleInstaller ~/Documents or python -m PythonAutomataLibrary.ExampleInstaller "C:\\Users\\YourName\\Documents" on Windows. The installer creates PAL-Examples/ with runnable scripts and a Documentation/ directory of PDF and Markdown manuals, without downloading from GitHub; it refuses to overwrite an existing PAL-Examples/ folder. Graphical examples require a desktop display.
Build from source
PAL currently loads its native library from the package directory. Build it before importing PAL.
Windows, from an x64 Visual Studio Developer Command Prompt:
python build_native.py
Linux/macOS:
python build_native.py
Then run the tests:
python -m pytest -q Testing
Architecture
NativeCore.py is the Python/Numba API and compilation layer. pal_native.c owns stable mutable simulation state and the workhorse native algorithms.
The public API has dedicated regression coverage in Testing/API/; the full Testing/ tree is the integration gate.
Citation
If you use PAL in your research, please cite:
Bravo, R. R. (2026). Python Automata Library (PAL) [Computer software]. Zenodo. https://doi.org/10.5281/zenodo.23439298
For reproducibility, report the specific PAL version used in your study.
GitHub's Cite this repository button provides citation formats from CITATION.cff.
PAL is a Python implementation of the Hybrid Automata Library (HAL) and builds substantially on that work. Please also cite the original HAL paper:
Bravo, R. R., et al. (2020). Hybrid Automata Library: A flexible platform for hybrid modeling with real-time visualization. PLOS Computational Biology, 16(3), e1007635. https://doi.org/10.1371/journal.pcbi.1007635
Metadata
Release files for PythonAutomataLibrary 1.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pythonautomatalibrary-1.1.0.tar.gz | 964.3 kB | With provenance | Details for pythonautomatalibrary-1.1.0.tar.gz |
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| pythonautomatalibrary-1.1.0-py3-none-win_amd64.whl | Python 3 | none | Windows x86-64 | Details for pythonautomatalibrary-1.1.0-py3-none-win_amd64.whl |
| pythonautomatalibrary-1.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl | Python 3 | none | Linux glibc 2.24+ x86-64, Linux glibc 2.28+ x86-64 | Details for pythonautomatalibrary-1.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
| pythonautomatalibrary-1.1.0-py3-none-macosx_11_0_arm64.whl | Python 3 | none | macOS 11.0+ ARM64 | Details for pythonautomatalibrary-1.1.0-py3-none-macosx_11_0_arm64.whl |
| pythonautomatalibrary-1.1.0-py3-none-macosx_10_13_x86_64.whl | Python 3 | none | macOS 10.13+ x86-64 | Details for pythonautomatalibrary-1.1.0-py3-none-macosx_10_13_x86_64.whl |
Total release size: 5.1 MB
Release files / pythonautomatalibrary-1.1.0.tar.gz
| Download URL | pythonautomatalibrary-1.1.0.tar.gz |
|---|---|
| Size | 964.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f1f6bcf5862dab1e0f2d45480a97eb62efc322ff51b6cf755add7fc0a8cb7a0e
|
|
BLAKE2b-256 checksum How to use checksums |
ef669390792224b6fbc26cbb3f9c00497299dc368db6ac82f599de278d5df59f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logRelease files / pythonautomatalibrary-1.1.0-py3-none-win_amd64.whl
| Download URL | pythonautomatalibrary-1.1.0-py3-none-win_amd64.whl |
|---|---|
| Size | 1.1 MB |
| Tags | Python 3 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
81d609d994deb4df05d71c4ee5d1fc8563e85654bc2693567a259dd48fb897e5
|
|
BLAKE2b-256 checksum How to use checksums |
1ed36d20bed06ac6b05f96f331f404a7baa675172c7c91e9033c98d5559f0aab
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logRelease files / pythonautomatalibrary-1.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl
| Download URL | pythonautomatalibrary-1.1.0-py3-none-manylinux_2_24_x86_64.manylinux_2_28_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Linux glibc 2.24+ x86-64 Linux glibc 2.28+ x86-64 Python 3 |
|
SHA-256 checksum How to use checksums |
fa36cc9bf143c5defd5c28b96092896ffdd636a671fcc9a57b450bf651525683
|
|
BLAKE2b-256 checksum How to use checksums |
6a9a596d9dc7cdb828c9a1ce8d48c8570cb2fdbfa308101cc6676bcf7a0e85d0
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logRelease files / pythonautomatalibrary-1.1.0-py3-none-macosx_11_0_arm64.whl
| Download URL | pythonautomatalibrary-1.1.0-py3-none-macosx_11_0_arm64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Python 3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
4e6a5af4ab63d884dbeb6540b3f4733b864417518eb73bca1924ce19bdf3266f
|
|
BLAKE2b-256 checksum How to use checksums |
c2a2b52135c2c288301a102727b83836f34f00605860cff506b5b260a2e91986
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logRelease files / pythonautomatalibrary-1.1.0-py3-none-macosx_10_13_x86_64.whl
| Download URL | pythonautomatalibrary-1.1.0-py3-none-macosx_10_13_x86_64.whl |
|---|---|
| Size | 1.0 MB |
| Tags | Python 3 macOS 10.13+ x86-64 |
|
SHA-256 checksum How to use checksums |
86d14b3aba5f7d9c2581b80da90ce8c39243985d81fe872f81f30cd75549c870
|
|
BLAKE2b-256 checksum How to use checksums |
11886556b21ca2dfd3f57da3621cea87d0b3ada7565421ffd8766bf833f8bf96
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 6, 2026.
Transparency logSecurity for PythonAutomataLibrary 1.1.0
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.
Full provenance
All 5 files in this release have been uploaded with provenance metadata.
Attestation for pythonautomatalibrary-1.1.0.tar.gz
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 Nov 6, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.