Ruly
Ruly is a simple, lightweight rule engine that can be used to define rules and prove statements using backward chaining. It attempts to be highly configurable, allowing callers of its functions to define callbacks in cases for conflict resolutions or derivations of new rules.
Installation
Ruly can be installed and used as a Python package. It can be installed by calling:
pip install ruly
Usage
import ruly
knowledge_base = ruly.knowledge_base.create([
"IF color = 'red' THEN creature = 'dragon'",
"IF color = 'grey' THEN creature = 'rat'"])
print(ruly.backward_chain(knowledge_base, 'creature', color='red'))
# prints dragon
For more examples and information on how to create new rules, solve conflicts, generate new rules on the fly during evaluations, etc., see the documentation.
Development environment
To set up the development environment, requirements must be installed either by
calling setup.py or by installing them manually using pip and
requirements.txt file. Also, ruly's build tool, doit
needs to be installed. Supported tasks can be listed by calling:
doit list
Metadata
Release files for ruly-zlatsic 0.0.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 | |
|---|---|---|---|
| ruly-zlatsic-0.0.1.tar.gz | 5.5 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ruly_zlatsic-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 12.8 kB
Release files / ruly-zlatsic-0.0.1.tar.gz
| Download URL | ruly-zlatsic-0.0.1.tar.gz |
|---|---|
| Size | 5.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ec9bc1c69a2d7abf0d3a5a923958f6cf63a02300859380769c01294d6ae95403
|
|
BLAKE2b-256 checksum How to use checksums |
075d18990d78f5a22f66a9c30f251f97e9a5b679ddcfad03874bca8d411c6a98
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|
Release files / ruly_zlatsic-0.0.1-py3-none-any.whl
| Download URL | ruly_zlatsic-0.0.1-py3-none-any.whl |
|---|---|
| Size | 7.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
97b6a41399696be983e076503e923c4c58ffff1a3a5e2a2506b91b00ac9a25ca
|
|
BLAKE2b-256 checksum How to use checksums |
3ae4145b0dde6fd5e60bc5d4e6612d58ab2575992f6dac4cdbc9b36976195b38
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.50.0 CPython/3.8.5
|