Skip to content

Commit

Permalink
Feature/prepare_release (#15)
Browse files Browse the repository at this point in the history
* docs: refactor documentation #3

Signed-off-by: develop-cs <[email protected]>

* docs: add project page

Signed-off-by: develop-cs <[email protected]>

* docs: refactor the doc

Signed-off-by: develop-cs <[email protected]>

* docs: add arta logos

Signed-off-by: develop-cs <[email protected]>

* fix: fix typos

Signed-off-by: develop-cs <[email protected]>

* chore: use built-in type hints

Signed-off-by: develop-cs <[email protected]>

* docs: change package description

Signed-off-by: develop-cs <[email protected]>

* fix: some links

Signed-off-by: develop-cs <[email protected]>

* fix: typos

Signed-off-by: develop-cs <[email protected]>

---------

Signed-off-by: develop-cs <[email protected]>
  • Loading branch information
develop-cs authored Jun 7, 2024
1 parent 294e476 commit fe5c31a
Show file tree
Hide file tree
Showing 50 changed files with 6,105 additions and 694 deletions.
16 changes: 8 additions & 8 deletions .github/ISSUE_TEMPLATE/bug_report.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,25 +7,25 @@ assignees: ''

---

**Describe the bug**
**Describe the bug**:
A clear and concise description of what the bug is.

**To Reproduce**
**To Reproduce**:
Steps to reproduce the behavior:
1. Import '...'
2. Call '....'
3. See error

**Expected behavior**
**Expected behavior**:
A clear and concise description of what you expected to happen.

**Screenshots**
**Screenshots**:
If applicable, add screenshots to help explain your problem.

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

**Additional context**
**Additional context**:
Add any other context about the problem here.
8 changes: 4 additions & 4 deletions .github/ISSUE_TEMPLATE/feature_request.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,14 +7,14 @@ assignees: ''

---

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

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

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

**Additional context**
**Additional context**:
Add any other context or screenshots about the feature request here.
6 changes: 3 additions & 3 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ Explain with one or more sentences what this change is doing.
## Have you done?
- [ ] Code tests
- [ ] Update documentation
- [ ] Update [changelog](https://github.com/MAIF/arta/blob/main/CHANGELOG.md).
- [ ] Update [changelog](https://github.com/MAIF/arta/blob/main/CHANGELOG.md)

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

## Linked issues (optional)
## Linked issues: (optional)
- Close ...
- Close ...
3 changes: 2 additions & 1 deletion .github/workflows/ci-cd-docs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ on:
jobs:
build:
if: ${{ github.actor != 'dependabot[bot]' }}
name: Check docs build
name: Build doc
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
Expand All @@ -37,6 +37,7 @@ jobs:
path: "docs/site/"
publish:
if: success() && startsWith(github.ref, 'refs/tags')
name: Publish doc
needs: build
permissions:
pages: write
Expand Down
4 changes: 2 additions & 2 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ All notable changes to this project will be documented in this file.

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

## [0.7.0] - April, 2024
## [0.7.0b] - April, 2024

### New Features
- Beta release implementing what you can find in its [documentation](https://pages.github.com/MAIF/arta).
- Beta release implementing what you can find in its [documentation](https://pages.github.com/MAIF/arta/home).
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ We encourage changes that make it easier to achieve our goals in an efficient wa

## Codebase

explain the layout of your repo.
Explain the layout of your repo.

## Workflow

Expand All @@ -22,7 +22,7 @@ We follow the standard GitHub [fork & pull](https://help.github.com/articles/usi
- Please make sure to follow the general quality guidelines (specified below) when developing your patch.
- Please write additional tests covering your feature and adjust existing ones if needed before submitting your pull request.
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).
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.
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.
1. Now it's finally time to [submit the pull request](https://help.github.com/articles/using-pull-requests)!
- 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".
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.
Expand Down
120 changes: 112 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,21 +1,122 @@
# Arta
<p align="center">
<a href="https://maif.github.io/arta"><img src="docs/pages/assets/img/arta-fond-clair.svg" alt="Arta" width="50%"></a>
</p>
<p align="center">
<em>Make rule handling simple</em>
</p>
<p align="center">
<img src="https://github.com/MAIF/arta/actions/workflows/ci-cd.yml/badge.svg?branch=main" alt="CI">
<img src="https://img.shields.io/badge/coverage-95%25-dark_green" alt="Coverage">
<img src="https://img.shields.io/pypi/v/arta" alt="Versions">
<img src="https://img.shields.io/pypi/pyversions/arta" alt="Python">
<img src="https://img.shields.io/pypi/dm/arta" alt="Downloads">
</p>

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

[![Alt MAIF Logo](https://static.maif.fr/resources/img/logo-maif.svg)](https://www.maif.fr/)
**Documentation:** [https://pages.github.com/MAIF/arta/home](https://pages.github.com/MAIF/arta/home)

**Repository:** [https://github.com/MAIF/arta](https://github.com/MAIF/arta)

---

## Overview

**Arta** is a simple python rules engine designed for python developers.

### Goal

There is one main reason for using **Arta** and it was the main goal of 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](https://github.com/maif/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`).

**Arta** is a very simple python rules engine designed for and by python developers.
`rules.yaml` :

## Reference Documentation
```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

The reference documentation is available [here](https://solid-eureka-93ze9kn.pages.github.io/).
actions_source_modules:
- actions
```
`actions.py` :

```python
def set_admission(value: bool, **kwargs: Any) -> dict[str, bool]:
"""Return a dictionary containing the admission result."""
return {"is_admitted": value}
```

`main.py` :

```python
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](https://pages.github.com/MAIF/arta/a_simple_example/) section for more details.

## Installation

Install using `pip install -U arta`. See the [Install](https://pages.github.com/MAIF/arta/installation/) section in the documentation for more details.

## What's New

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

## Community

You can discuss and ask *Arta* related questions:

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

## License

This project is Open Source and available under the Apache 2 License.
This project is Open Source and available under the Apache 2 License.

[![Alt MAIF Logo](https://static.maif.fr/resources/img/logo-maif.svg)](https://www.maif.fr/)

12 changes: 6 additions & 6 deletions docs/mkdocs.yaml
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
site_name: Arta
site_url: https://pages.github.com/MAIF/arta
site_url: https://maif.github.io/arta
repo_url: https://github.com/MAIF/arta
repo_name: MAIF/arta
site_author: OSSbyMAIF Team
docs_dir: pages
theme:
name: 'material'
logo: https://static.maif.fr/resources/img/logo-maif.svg
favicon: https://static.maif.fr/resources/img/logo-maif.svg
logo: assets/img/arta-fond-clair.svg
favicon: assets/img/arta-git.svg
palette:
primary: white
accent: light green
accent: red
font:
text: 'Roboto'
code: 'Roboto Mono'
Expand Down Expand Up @@ -51,9 +51,9 @@ plugins:
- mkdocstrings
- search
nav:
- Home: index.md
- Home: home.md
- Get Started:
- In a nutshell: in_a_nutshell.md
- A Simple Example: a_simple_example.md
- Installation: installation.md
- Why use Arta?: why.md
- User Guide:
Expand Down
Loading

0 comments on commit fe5c31a

Please sign in to comment.