Make rule handling simple
Documentation: https://maif.github.io/arta/home/
Repository: https://github.com/MAIF/arta
Overview
Arta is an open source python rules engine designed for and by python developers.
Goal
There is one main reason for using Arta and it was the main goal behind its development at MAIF: increase business rules maintainability.
In other words, facilitate rules handling in our python apps.
Origins
The need of a python rules engine emerged when we were working on a new major release of our internal use of Melusine (i.e., email qualification pipeline with ML capabilities).
We were looking for a python library to centralize, manage and standardize all the implemented business rules we had but didn't find the perfect fit.
Therefore, we decided to create this package and by extension of the MAIF's values, we planned to share it to the community.
Features
- Standardize the definition of a rule. All rules are defined the same way in a unique place.
- Rules are released from the code base, which is less error prone and increases clearness.
- Use Arta whatever your field is.
- Great combination with Machine Learning: groups all the deterministic rules of your ML projects.
A Simple Example
Create the three following files and run the main.py script (python main.py or python3 main.py).
rules.yaml :
---
rules:
default_rule_set:
admission:
ADMITTED:
simple_condition: input.power=="strength" or input.power=="fly"
action: set_admission
action_parameters:
value: true
NOT_ADMITTED:
simple_condition: null
action: set_admission
action_parameters:
value: false
actions_source_modules:
- actions
actions.py :
from typing import Any
def set_admission(value: bool) -> dict[str, bool]:
"""Return a dictionary containing the admission result."""
return {"is_admitted": value}
main.py :
from arta import RulesEngine
eng = RulesEngine(config_path=".")
data = {
"id": 1,
"name": "Superman",
"civilian_name": "Clark Kent",
"age": None,
"city": "Metropolis",
"language": "english",
"power": "fly",
"favorite_meal": "Spinach",
"secret_weakness": "Kryptonite",
}
result = eng.apply_rules(input_data=data)
print(result)
You should get: {"admission": {"is_admitted": True}}
Check the A Simple Example section for more details.
Installation
Install using pip install -U:
pip install -U arta
See the Install section in the documentation for more details.
What's New
Want to see last updates, check the Release Notes or the Changelog.
Community
You can discuss and ask Arta related questions:
Contributing
Contributions are very welcome!
If you see an issue that you'd like to see fixed, the best way to make it happen is to help out by submitting a pull request implementing it.
Refer to the CONTRIBUTING.md file for more details about the workflow, and general hints on how to prepare your pull request. You can also ask for clarifications or guidance in GitHub issues directly.
License
This project is Open Source and available under the Apache 2 License.
Metadata
Release files for arta 0.11.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 |
|---|---|---|---|---|
| arta-0.11.1.tar.gz | 22.4 kB | With provenance | Details for arta-0.11.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| arta-0.11.1-py3-none-any.whl | Python 3 | none | any | Details for arta-0.11.1-py3-none-any.whl |
Total release size: 45.3 kB
Release files / arta-0.11.1.tar.gz
| Download URL | arta-0.11.1.tar.gz |
|---|---|
| Size | 22.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
13f6e210c17a543642e089d28ae7dcbea13f3a4980c0de33c95629e21b457300
|
|
BLAKE2b-256 checksum How to use checksums |
4d61d0fab43c0fde8cb3762d2e0af0c1d3835b574264a70377920bfc669c8763
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 10, 2025.
Transparency logRelease files / arta-0.11.1-py3-none-any.whl
| Download URL | arta-0.11.1-py3-none-any.whl |
|---|---|
| Size | 22.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
60166f5cfe9a5f929158bfd7aea64f3865ce25ea9b4cad19cfa84647fdc6e09c
|
|
BLAKE2b-256 checksum How to use checksums |
d59caf918baa480f3e0ed48a7483f7ed23b30a97ef1c9798ab95816adeca3386
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/6.1.0 CPython/3.13.7
|
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 10, 2025.
Transparency logSecurity for arta 0.11.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
All 2 files in this release have been uploaded with provenance metadata.
Attestation for arta-0.11.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 Nov 10, 2025.
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.