{"id":20580250,"url":"https://github.com/maif/arta","last_synced_at":"2025-04-07T12:07:26.713Z","repository":{"id":243632705,"uuid":"774844587","full_name":"MAIF/arta","owner":"MAIF","description":"A Python Rules Engine - Make rule handling simple","archived":false,"fork":false,"pushed_at":"2025-03-11T11:43:14.000Z","size":248,"stargazers_count":40,"open_issues_count":7,"forks_count":6,"subscribers_count":4,"default_branch":"main","last_synced_at":"2025-03-31T11:02:51.359Z","etag":null,"topics":["maif","package","python","rule-engine","rules","rules-engine"],"latest_commit_sha":null,"homepage":"https://maif.github.io/arta/home","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/MAIF.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":"CODE_OF_CONDUCT.md","threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-03-20T09:48:10.000Z","updated_at":"2025-03-20T21:34:17.000Z","dependencies_parsed_at":"2024-06-10T10:36:35.083Z","dependency_job_id":"44d16fcb-6d97-4968-9b7d-3da158e7ccef","html_url":"https://github.com/MAIF/arta","commit_stats":{"total_commits":24,"total_committers":6,"mean_commits":4.0,"dds":"0.20833333333333337","last_synced_commit":"88ebd80338d2a094412f1149237f83344e1b9bb2"},"previous_names":["maif/arta"],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAIF%2Farta","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAIF%2Farta/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAIF%2Farta/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/MAIF%2Farta/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/MAIF","download_url":"https://codeload.github.com/MAIF/arta/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247648977,"owners_count":20972945,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["maif","package","python","rule-engine","rules","rules-engine"],"created_at":"2024-11-16T06:22:07.065Z","updated_at":"2025-04-07T12:07:26.706Z","avatar_url":"https://github.com/MAIF.png","language":"Python","readme":"\u003cp align=\"center\"\u003e\n  \u003ca href=\"https://maif.github.io/arta/\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/MAIF/arta/main/docs/pages/assets/img/arta-fond-clair.svg\" alt=\"Arta\" width=\"50%\"\u003e\u003c/a\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n    \u003cem\u003eMake rule handling simple\u003c/em\u003e\n\u003c/p\u003e\n\u003cp align=\"center\"\u003e\n  \u003cimg src=\"https://github.com/MAIF/arta/actions/workflows/ci-cd.yml/badge.svg?branch=main\" alt=\"CI\"\u003e\n  \u003cimg src=\"https://img.shields.io/badge/coverage-95%25-dark_green\" alt=\"Coverage\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/v/arta\" alt=\"Versions\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/pyversions/arta\" alt=\"Python\"\u003e\n  \u003cimg src=\"https://img.shields.io/pypi/implementation/arta\" alt=\"Python implementation\"\u003e\n  \u003cimg src=\"https://img.shields.io/pepy/dt/arta\" alt=\"Downloads\"\u003e\n\u003c/p\u003e\n\n---\n\n**Documentation:** [https://maif.github.io/arta/home/](https://maif.github.io/arta/home/)\n\n**Repository:** [https://github.com/MAIF/arta](https://github.com/MAIF/arta)\n\n---\n\n## Overview\n\n**Arta** is an *open source* python rules engine designed for and by python developers.\n\n### Goal\n\nThere is one main reason for using **Arta** and it was the main goal behind its development at *MAIF*: increase business rules maintainability.\n\nIn other words, facilitate rules handling in our python apps.\n\n### Origins\n\nThe need of a python *rules engine* emerged when we were working on a new major release of our internal use of [Melusine](https://github.com/maif/melusine) (i.e., email qualification pipeline with ML capabilities).\n\nWe 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.\n\nTherefore, we decided to create this package and by extension of the MAIF's values, we planned to share it to the community.\n\n### Features\n\n* Standardize the definition of a rule. All rules are defined the same way in a unique place.\n* Rules are released from the code base, which is less error prone and increases clearness.\n* Use **Arta** whatever your field is.\n* Great combination with Machine Learning: groups all the deterministic rules of your ML projects.\n\n### A Simple Example\n\nCreate the three following files and run the `main.py` script (`python main.py` or `python3 main.py`).\n\n`rules.yaml` :\n\n```yaml\n---\nrules:\n  default_rule_set:\n    admission:\n      ADMITTED:\n        simple_condition: input.power==\"strength\" or input.power==\"fly\"\n        action: set_admission\n        action_parameters:\n          value: true  \n      NOT_ADMITTED:\n        simple_condition: null\n        action: set_admission\n        action_parameters:\n          value: false\n\nactions_source_modules:\n  - actions\n```\n\n`actions.py` :\n\n```python\nfrom typing import Any\n\n\ndef set_admission(value: bool) -\u003e dict[str, bool]:\n    \"\"\"Return a dictionary containing the admission result.\"\"\"\n    return {\"is_admitted\": value}\n```\n\n`main.py` :\n\n```python\nfrom arta import RulesEngine\n\neng = RulesEngine(config_path=\".\")\n\ndata = {\n        \"id\": 1,\n        \"name\": \"Superman\",\n        \"civilian_name\": \"Clark Kent\",\n        \"age\": None,\n        \"city\": \"Metropolis\",\n        \"language\": \"english\",\n        \"power\": \"fly\",\n        \"favorite_meal\": \"Spinach\",\n        \"secret_weakness\": \"Kryptonite\",\n        }\n\nresult = eng.apply_rules(input_data=data)\n\nprint(result)\n```\n\nYou should get: `{\"admission\": {\"is_admitted\": True}}`\n\nCheck the [A Simple Example](https://maif.github.io/arta/a_simple_example/) section for more details.\n\n## Installation\n\nInstall using `pip install -U`:\n\n```shell\npip install -U arta\n```\n\nSee the [Install](https://maif.github.io/arta/installation/) section in the documentation for more details.\n\n## What's New\n\nWant to see last updates, check the [Release Notes](https://github.com/MAIF/arta/releases) or the [Changelog](./CHANGELOG.md).\n\n## Community\n\nYou can discuss and ask *Arta* related questions:\n\n- Issue tracker: [![github: MAIF/arta/issues](https://img.shields.io/github/issues/MAIF/arta.svg)](https://github.com/MAIF/arta/issues)\n- Pull request: [![github: MAIF/arta/pulls](https://img.shields.io/github/issues-pr/MAIF/arta.svg)](https://github.com/MAIF/arta/pulls)\n\n## Contributing\n\nContributions are *very* welcome!\n\nIf 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.\n\nRefer to the [CONTRIBUTING.md](./CONTRIBUTING.md) file for more details about the workflow,\nand general hints on how to prepare your pull request. You can also ask for clarifications or guidance in GitHub issues directly.\n\n## License\n\nThis project is Open Source and available under the Apache 2 License.\n\n[![Alt MAIF Logo](https://static.maif.fr/resources/img/logo-maif.svg)](https://www.maif.fr/)\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaif%2Farta","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fmaif%2Farta","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fmaif%2Farta/lists"}