Skip to main content

DMN implementation with ruly rule engine

Project description

Ruly-DMN

ruly-dmn is a python package that offers a limited implementation of the DMN standard, with additional features. It relies on the ruly rule engine to make decisions and derive new rules. It can be used as a library or as a command line tool.

The package assumes that the DMN diagrams are defined as XML files, in the format specified by the Camunda modeler. The recommended workflow is to use the Camunda modeler to create diagrams and initial decision tables and then pass them to functions in this package, so it can make decisions or derive new rules. See the examples directory for examples of working DMN files that can both be opened in the Camunda modeler and passed to the functions of this package.

The current limitations, in regard to the complete DMN standard:

  • only available hit policy are unique, first,
  • there are no constraints on enumerated variables when user is entering new rules
  • only one output column in decision tables is allowed
  • only available variable comparision (when making decisions) is for operators equals, greater, greater or equal, less and less or equal
  • visual diagrams are not taken into account when creating rule engine rules, only decision tables
  • the package functions are not guarenteed to work if the DMN file is incorrect
  • S-Feel and other code evaluations in rules are not supported

Installation

To install, call:

pip install ruly-dmn

Usage

When the package is installed, it can be used either by importing its modules (see documentation for more details), or by calling ruly-dmn in command line. Alternatively, python -m ruly_dmn.main may be used instead of the command line tool.

After installation, it should be possible to call ruly-dmn with one of the DMN diagrams in the example directories, i.e.:

ruly-dmn -o o.dmn examples/example1/diagram.dmn Beverage Season="Spring"

Which should output Beverage = Pinot Noir. The tool also may create new rules and, if it does, these rules should be written in o.dmn file. For more information on how the command line tool works, call ruly-dmn --help

Development environment

To install development dependencies, call

pip install -r requirements.txt

This will, among other packages, install doit, which is ruly-dmn's build tool. Use this tool to perform various actions like testing, building documentation, linting check, etc. For the list of all available tasks, call:

doit list

Contributing

Feel free to post any issues - bugs, feature requests, etc. Do not send pull requests before an issue for the problem it solves is created. When sending pull requests, please reference the issue(s) it attempts to solve and, after the review process, it will be accepted. Make sure that the updated changes reflect on the documentation and tests, so they're not left in an inconsistent state.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ruly-dmn-0.0.5.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ruly_dmn-0.0.5-py3-none-any.whl (9.9 kB view details)

Uploaded Python 3

File details

Details for the file ruly-dmn-0.0.5.tar.gz.

File metadata

  • Download URL: ruly-dmn-0.0.5.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.1

File hashes

Hashes for ruly-dmn-0.0.5.tar.gz
Algorithm Hash digest
SHA256 223e6d23379ec132e0e7ba35503bd5bc268f615734611e047304f5e9964e50c1
MD5 7b6354d014d3006d2a551e94b43b7fc0
BLAKE2b-256 a7669c3bb6e289a62bd5b485beee7b5c2104c5a46f16aa28c4e129e86769e342

See more details on using hashes here.

File details

Details for the file ruly_dmn-0.0.5-py3-none-any.whl.

File metadata

  • Download URL: ruly_dmn-0.0.5-py3-none-any.whl
  • Upload date:
  • Size: 9.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.2.0 pkginfo/1.5.0.1 requests/2.24.0 setuptools/41.2.0 requests-toolbelt/0.9.1 tqdm/4.50.1 CPython/3.8.1

File hashes

Hashes for ruly_dmn-0.0.5-py3-none-any.whl
Algorithm Hash digest
SHA256 f9aacad36582bbd3d469aab1484bd035e9c220952dc912b64edd229c29278205
MD5 3ce12f43a0566d2d44ba1ef365970a5f
BLAKE2b-256 8ce446b4cb9bd1c69dbc43afe26d73f1e63afc59d4dca9f7184e69a5eab77048

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page