rulesatlas
All and only the state needed to check game rules: plausible states, permitted next events, rule consequences and outcomes. No simulation or physical model.
A native rule library for game-state validation, legal next actions, transitions
and outcomes, with a bounded interpreter for user-defined JSON rules.
list_games() lists accepted profiles. All 212 retained profiles have accepted, explicitly bounded variants. Read get_game(id) for the exact
variant, required inputs and limitations; acceptance does not certify every
commercial or federation edition.
import rulesatlas
rulesatlas.register_rules("first_to_three.json")
state = rulesatlas.new_state(
"user.first_to_three", players=[{"id": "alice"}, {"id": "bob"}],
ruleset_version="1.0.0",
)
state = rulesatlas.apply_action(state, {"type": "score", "params": {"player": 0}})
print(rulesatlas.outcome(state))
Supply a local JSON rulepack matching the bundled contract examples. Registration
is process-local and copies input data. Changed rules require a new version;
overwrite=True does not replace an immutable registered version. Nonempty
variants are not yet supported by the custom interpreter and are rejected.
Expressions use a fixed operator whitelist. Effects read the old state and commit
atomically after validation. No executable code, shell, network, randomness or
strategy is invoked by rules. Unknown rules and invalid actions raise RuleError
with a stable code. validate_rules and validate_state return structured
issues. Custom validation checks structure and declared fields, not arbitrary
historical reachability.
Finite parameter domains are enumerated up to 512 combinations; larger domains
return guarded event types with completeness=False. Winners are participant
IDs. Built-in candidates are visible only with list_games(True) until accepted.
The PyPI distribution and Python import name are both rulesatlas.
python -m pip install rulesatlas
Built-in match rules
S001 implements compact football match rules: goals, per-player cards,
eligibility, substitutions, phases and optional knockout progression.
Use get_game("S001") for its declared variant and limitations, and
legal_actions(state) for phase-dependent event types and remaining allowances.
The repository includes a Python football example in examples/football.py.
No ball motion, possession or injury state is stored.
GitHub source repository
Repository: rds0001/rulesatlas-python. The package name remains unchanged.
Install from this repository root:
python -m pip install .
Source repository: https://github.com/rds0001/rulesatlas-python
CI results: https://github.com/rds0001/rulesatlas-python/actions
Release artifacts are checked before publication to PyPI.
Metadata
Release files for rulesatlas 0.0.1
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 |
|---|---|---|---|---|
| rulesatlas-0.0.1.tar.gz | 823.4 kB | With provenance | Details for rulesatlas-0.0.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| rulesatlas-0.0.1-py3-none-any.whl | Python 3 | none | any | Details for rulesatlas-0.0.1-py3-none-any.whl |
Total release size: 1.5 MB
Release files / rulesatlas-0.0.1.tar.gz
| Download URL | rulesatlas-0.0.1.tar.gz |
|---|---|
| Size | 823.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
760793e6bfef29761b07c4fb5ebcf5da40e90d8765b24e3c9f43cd0eb9166d27
|
|
BLAKE2b-256 checksum How to use checksums |
3f73ff05e4ae5e885644b23c283adaf272a7abb572f88ccb1d790c91bb4ba123
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logRelease files / rulesatlas-0.0.1-py3-none-any.whl
| Download URL | rulesatlas-0.0.1-py3-none-any.whl |
|---|---|
| Size | 631.6 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0afd449a9a86e49c08e85b693da46a2ef46421c6b95a6620079e83134293fb36
|
|
BLAKE2b-256 checksum How to use checksums |
3c918bad7bbb4f232fc6674b7a5e9494834980901896470889b7e6c855b57124
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
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 Oct 19, 2026.
Transparency logSecurity for rulesatlas 0.0.1
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
Both files in this release have been uploaded with provenance metadata.
Attestation for rulesatlas-0.0.1.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 Oct 19, 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.