You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: CHANGELOG.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
4
4
5
5
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
6
6
7
-
## [0.7.0] - April, 2024
7
+
## [0.7.0b] - April, 2024
8
8
9
9
### New Features
10
-
- Beta release implementing what you can find in its [documentation](https://pages.github.com/MAIF/arta).
10
+
- Beta release implementing what you can find in its [documentation](https://pages.github.com/MAIF/arta/home).
Copy file name to clipboardExpand all lines: CONTRIBUTING.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -7,7 +7,7 @@ We encourage changes that make it easier to achieve our goals in an efficient wa
7
7
8
8
## Codebase
9
9
10
-
explain the layout of your repo.
10
+
Explain the layout of your repo.
11
11
12
12
## Workflow
13
13
@@ -22,7 +22,7 @@ We follow the standard GitHub [fork & pull](https://help.github.com/articles/usi
22
22
- Please make sure to follow the general quality guidelines (specified below) when developing your patch.
23
23
- Please write additional tests covering your feature and adjust existing ones if needed before submitting your pull request.
24
24
1. Once your feature is complete, prepare the commit with a good commit message, for example: `Adding canary mode support for services #42` (note the reference to the ticket it aimed to resolve).
25
-
1. If it's a new feature, or a change of behaviour, document it on the [Arta docs](https://github.com/MAIF/arta/tree/master/manual), remember, an undocumented feature is not a feature.
25
+
1. If it's a new feature, or a change of behaviour, document it on the [Arta docs](https://pages.github.com/MAIF/arta/home), remember, an undocumented feature is not a feature.
26
26
1. Now it's finally time to [submit the pull request](https://help.github.com/articles/using-pull-requests)!
27
27
- Please make sure to include a reference to the issue you're solving *in the comment* for the Pull Request, this will cause the PR to be linked properly with the Issue. Examples of good phrases for this are: "Resolves #1234" or "Refs #1234".
28
28
1. Now both committers and interested people will review your code. This process is to ensure the code we merge is of the best possible quality, and that no silly mistakes slip through. You're expected to follow-up these comments by adding new commits to the same branch. The commit messages of those commits can be more loose, for example: `Removed debugging using printline`, as they all will be squashed into one commit before merging into the main branch.
**Arta** is a simple python rules engine designed for python developers.
26
+
27
+
### Goal
28
+
29
+
There is one main reason for using **Arta** and it was the main goal of its development at *MAIF*: increase business rules maintainability.
30
+
31
+
In other words, facilitate rules handling in our python apps.
32
+
33
+
### Origins
34
+
35
+
The 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).
36
+
37
+
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.
38
+
39
+
Therefore, we decided to create this package and by extension of the MAIF's values, we planned to share it to the community.
40
+
41
+
### Features
42
+
43
+
* Standardize the definition of a rule. All rules are defined the same way in a unique place.
44
+
* Rules are released from the code base, which is less error prone and increases clearness.
45
+
* Use **Arta** whatever your field is.
46
+
* Great combination with Machine Learning: groups all the deterministic rules of your ML projects.
47
+
48
+
### A Simple Example
49
+
50
+
Create the three following files and run the `main.py` script (`python main.py` or `python3 main.py`).
7
51
8
-
**Arta** is a very simple python rules engine designed for and by python developers.
52
+
`rules.yaml` :
9
53
10
-
## Reference Documentation
54
+
```yaml
55
+
---
56
+
rules:
57
+
default_rule_set:
58
+
admission:
59
+
ADMITTED:
60
+
simple_condition: input.power=="strength" or input.power=="fly"
61
+
action: set_admission
62
+
action_parameters:
63
+
value: True
64
+
NOT_ADMITTED:
65
+
simple_condition: null
66
+
action: set_admission
67
+
action_parameters:
68
+
value: False
11
69
12
-
The reference documentation is available [here](https://solid-eureka-93ze9kn.pages.github.io/).
"""Return a dictionary containing the admission result."""
79
+
return {"is_admitted": value}
80
+
```
81
+
82
+
`main.py` :
83
+
84
+
```python
85
+
from arta import RulesEngine
86
+
87
+
eng = RulesEngine(config_path=".")
88
+
89
+
data = {
90
+
"id": 1,
91
+
"name": "Superman",
92
+
"civilian_name": "Clark Kent",
93
+
"age": None,
94
+
"city": "Metropolis",
95
+
"language": "english",
96
+
"power": "fly",
97
+
"favorite_meal": "Spinach",
98
+
"secret_weakness": "Kryptonite",
99
+
}
100
+
101
+
result = eng.apply_rules(input_data=data)
102
+
103
+
print(result)
104
+
```
105
+
106
+
You should get: `{"admission": {"is_admitted": True}}`
107
+
108
+
Check the [A Simple Example](https://pages.github.com/MAIF/arta/a_simple_example/) section for more details.
109
+
110
+
## Installation
111
+
112
+
Install using `pip install -U arta`. See the [Install](https://pages.github.com/MAIF/arta/installation/) section in the documentation for more details.
13
113
14
114
## What's New
15
115
16
116
Want to see last updates, check the [Release Notes](https://github.com/MAIF/arta/releases) or the [Changelog](./CHANGELOG.md).
0 commit comments