Skip to content

Commit fe5c31a

Browse files
authored
Feature/prepare_release (#15)
* docs: refactor documentation #3 Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * docs: add project page Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * docs: refactor the doc Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * docs: add arta logos Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * fix: fix typos Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * chore: use built-in type hints Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * docs: change package description Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * fix: some links Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> * fix: typos Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com> --------- Signed-off-by: develop-cs <43383361+develop-cs@users.noreply.github.com>
1 parent 294e476 commit fe5c31a

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

50 files changed

+6105
-694
lines changed

.github/ISSUE_TEMPLATE/bug_report.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -7,25 +7,25 @@ assignees: ''
77

88
---
99

10-
**Describe the bug**
10+
**Describe the bug**:
1111
A clear and concise description of what the bug is.
1212

13-
**To Reproduce**
13+
**To Reproduce**:
1414
Steps to reproduce the behavior:
1515
1. Import '...'
1616
2. Call '....'
1717
3. See error
1818

19-
**Expected behavior**
19+
**Expected behavior**:
2020
A clear and concise description of what you expected to happen.
2121

22-
**Screenshots**
22+
**Screenshots**:
2323
If applicable, add screenshots to help explain your problem.
2424

2525
**Desktop (please complete the following information):**
26-
- OS: [e.g. linux]
27-
- Python version [e.g. 3.12]
28-
- Dependencies versions [e.g. pydantic 2.6.4]
26+
- OS: `[e.g. linux]`
27+
- Python version(s): `[e.g. 3.12]`
28+
- Dependencies versions: `[e.g. pydantic 2.6.4]`
2929

30-
**Additional context**
30+
**Additional context**:
3131
Add any other context about the problem here.

.github/ISSUE_TEMPLATE/feature_request.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ assignees: ''
77

88
---
99

10-
**Is your feature request related to a problem? Please describe**
10+
**Is your feature request related to a problem? Please describe**:
1111
A clear and concise description of what the problem is. Ex. I'm always frustrated when [...]
1212

13-
**Describe the solution you'd like**
13+
**Describe the solution you'd like**:
1414
A clear and concise description of what you want to happen.
1515

16-
**Describe alternatives you've considered**
16+
**Describe alternatives you've considered**:
1717
A clear and concise description of any alternative solutions or features you've considered.
1818

19-
**Additional context**
19+
**Additional context**:
2020
Add any other context or screenshots about the feature request here.

.github/PULL_REQUEST_TEMPLATE.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ Explain with one or more sentences what this change is doing.
44
## Have you done?
55
- [ ] Code tests
66
- [ ] Update documentation
7-
- [ ] Update [changelog](https://github.com/MAIF/arta/blob/main/CHANGELOG.md).
7+
- [ ] Update [changelog](https://github.com/MAIF/arta/blob/main/CHANGELOG.md)
88

9-
## Details to be checked (optional)
9+
## Details to be checked: (optional)
1010
If needed, add some details here in order to verify the change (e.g., how to test).
1111

12-
## Linked issues (optional)
12+
## Linked issues: (optional)
1313
- Close ...
1414
- Close ...

.github/workflows/ci-cd-docs.yml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ on:
1616
jobs:
1717
build:
1818
if: ${{ github.actor != 'dependabot[bot]' }}
19-
name: Check docs build
19+
name: Build doc
2020
runs-on: ubuntu-latest
2121
steps:
2222
- uses: actions/checkout@v4
@@ -37,6 +37,7 @@ jobs:
3737
path: "docs/site/"
3838
publish:
3939
if: success() && startsWith(github.ref, 'refs/tags')
40+
name: Publish doc
4041
needs: build
4142
permissions:
4243
pages: write

CHANGELOG.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.
44

55
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).
66

7-
## [0.7.0] - April, 2024
7+
## [0.7.0b] - April, 2024
88

99
### 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).

CONTRIBUTING.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ We encourage changes that make it easier to achieve our goals in an efficient wa
77

88
## Codebase
99

10-
explain the layout of your repo.
10+
Explain the layout of your repo.
1111

1212
## Workflow
1313

@@ -22,7 +22,7 @@ We follow the standard GitHub [fork & pull](https://help.github.com/articles/usi
2222
- Please make sure to follow the general quality guidelines (specified below) when developing your patch.
2323
- Please write additional tests covering your feature and adjust existing ones if needed before submitting your pull request.
2424
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.
2626
1. Now it's finally time to [submit the pull request](https://help.github.com/articles/using-pull-requests)!
2727
- 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".
2828
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.

README.md

Lines changed: 112 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,122 @@
1-
# Arta
1+
<p align="center">
2+
<a href="https://maif.github.io/arta"><img src="docs/pages/assets/img/arta-fond-clair.svg" alt="Arta" width="50%"></a>
3+
</p>
4+
<p align="center">
5+
<em>Make rule handling simple</em>
6+
</p>
7+
<p align="center">
8+
<img src="https://github.com/MAIF/arta/actions/workflows/ci-cd.yml/badge.svg?branch=main" alt="CI">
9+
<img src="https://img.shields.io/badge/coverage-95%25-dark_green" alt="Coverage">
10+
<img src="https://img.shields.io/pypi/v/arta" alt="Versions">
11+
<img src="https://img.shields.io/pypi/pyversions/arta" alt="Python">
12+
<img src="https://img.shields.io/pypi/dm/arta" alt="Downloads">
13+
</p>
214

3-
![Alt CI](https://github.com/MAIF/arta/actions/workflows/ci-cd.yml/badge.svg?branch=main)
4-
![Alt Python](https://img.shields.io/badge/Python-3.9_--_3.12-blue)
15+
---
516

6-
[![Alt MAIF Logo](https://static.maif.fr/resources/img/logo-maif.svg)](https://www.maif.fr/)
17+
**Documentation:** [https://pages.github.com/MAIF/arta/home](https://pages.github.com/MAIF/arta/home)
18+
19+
**Repository:** [https://github.com/MAIF/arta](https://github.com/MAIF/arta)
20+
21+
---
22+
23+
## Overview
24+
25+
**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`).
751

8-
**Arta** is a very simple python rules engine designed for and by python developers.
52+
`rules.yaml` :
953

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
1169

12-
The reference documentation is available [here](https://solid-eureka-93ze9kn.pages.github.io/).
70+
actions_source_modules:
71+
- actions
72+
```
73+
74+
`actions.py` :
75+
76+
```python
77+
def set_admission(value: bool, **kwargs: Any) -> dict[str, bool]:
78+
"""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.
13113

14114
## What's New
15115

16116
Want to see last updates, check the [Release Notes](https://github.com/MAIF/arta/releases) or the [Changelog](./CHANGELOG.md).
17117

18118
## Community
119+
19120
You can discuss and ask *Arta* related questions:
20121

21122
- Issue tracker: [![github: MAIF/arta/issues](https://img.shields.io/github/issues/MAIF/arta.svg)](https://github.com/MAIF/arta/issues)
@@ -32,4 +133,7 @@ and general hints on how to prepare your pull request. You can also ask for clar
32133

33134
## License
34135

35-
This project is Open Source and available under the Apache 2 License.
136+
This project is Open Source and available under the Apache 2 License.
137+
138+
[![Alt MAIF Logo](https://static.maif.fr/resources/img/logo-maif.svg)](https://www.maif.fr/)
139+

docs/mkdocs.yaml

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,16 @@
11
site_name: Arta
2-
site_url: https://pages.github.com/MAIF/arta
2+
site_url: https://maif.github.io/arta
33
repo_url: https://github.com/MAIF/arta
44
repo_name: MAIF/arta
55
site_author: OSSbyMAIF Team
66
docs_dir: pages
77
theme:
88
name: 'material'
9-
logo: https://static.maif.fr/resources/img/logo-maif.svg
10-
favicon: https://static.maif.fr/resources/img/logo-maif.svg
9+
logo: assets/img/arta-fond-clair.svg
10+
favicon: assets/img/arta-git.svg
1111
palette:
1212
primary: white
13-
accent: light green
13+
accent: red
1414
font:
1515
text: 'Roboto'
1616
code: 'Roboto Mono'
@@ -51,9 +51,9 @@ plugins:
5151
- mkdocstrings
5252
- search
5353
nav:
54-
- Home: index.md
54+
- Home: home.md
5555
- Get Started:
56-
- In a nutshell: in_a_nutshell.md
56+
- A Simple Example: a_simple_example.md
5757
- Installation: installation.md
5858
- Why use Arta?: why.md
5959
- User Guide:

0 commit comments

Comments
 (0)