Skip to main content

pySFeel

An implementation S-FEEL (Simple Expression Language) as specified in the DMN (Decision Model Notation) standard. pySFeel is implemented in Python, using the SLY module and has many FEEL features.

  • not, and and or in logical expressions which can be enclosed in round brackets (())
  • in() function, e.g. 5 in(<6)
  • Lists and filters
  • Contexts and filters
  • Ranges
  • Built in functions

pySFeel processes a single S-FEEL statement at a time. It is not intended to be a syntactically perfect implementation of S-FEEL, but rather an enabler for an implementation of DMN (Decision Model Notation) pyDMNrules. The internal data types are float, string, boolean, datetime.date, datetime.time, and datetime.timedelta. The S-FEEL constant null is mapped to None. Years and months durations are stored as floats. Days and time durations are stored as datetime.timedelta

There is one deliberate deviation from the standard - the key word 'item' in a Context filters is not optional. [{x:1,y:2},{x:2,y:3}][x=1] is not valid (as x=1 is either True or False), but [{x:1,y:2},{x:2,y:3}][item x=1] is valid and will return {x:1,y:2}. Similarly, fred.y is not the 'y' filter on the List of Contexts named 'fred' (as fred.y is a valid name). However (fred).y is the 'y' filter on the list of Contexts named fred.

There's one extension - an assignment operator (<-)

fred <- 7
bill <- 9
fred = bill

This will return False

fred <- [{x:1,y:2},{x:2,y:3}]
(fred).y

This will return [2,3]

USAGE:

import pySFeel
parser = pySFeel.SFeelParser()
sfeelText = '7.3 in [2.0 .. 9.1]'
(status, retVal) = parser.sFeelParse(sfeelText)
if 'errors' in status:
    print('With errors:', status['errors'])
  • retVal will be True
  • The dictonary 'status' will have the key 'errors' if you have errors in your sfeelText.
  • status['errors'] is a list of strings. It may help in diagnosing your S-FEEL syntax errors.

Documentation: More details can be found at readthedocs

Metadata

Release files for pySFeel 0.1.9

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for pySFeel 0.1.9
File Size Uploaded
pySFeel-0.1.9.tar.gz 13.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pySFeel 0.1.9
File Interpreter ABI Platform
pySFeel-0.1.9-py3-none-any.whl Python 3 none any Details

Total release size: 37.9 kB

Release files / pySFeel-0.1.9.tar.gz

Download URL pySFeel-0.1.9.tar.gz
Size 13.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c791bea70af94be5e081fb50f88b92177c80baca0c335652c29bebb1a548d273
BLAKE2b-256 checksum
How to use checksums
c48445a642187186ed672e97744503fc2aff1259ffcbddf30488e3c3687aa794
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

Release files / pySFeel-0.1.9-py3-none-any.whl

Download URL pySFeel-0.1.9-py3-none-any.whl
Size 24.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f09c14160f94908672b28897fdebaebb521d7bcd94282002b4a05fa693c76a6f
BLAKE2b-256 checksum
How to use checksums
89737cc6a5f479c2161c9ea526ef21a67e7a44cb5b3bc47bb67787f8517353da
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.22.0 setuptools/44.0.0 requests-toolbelt/0.9.1 tqdm/4.41.1 CPython/3.8.0

Release history Release notifications | RSS feed

1.4.2

2 release files

1.4.1

2 release files

1.4.0

2 release files

1.3.10

2 release files

1.3.9

2 release files

1.3.8

2 release files

1.3.7

2 release files

1.3.6

2 release files

1.3.5

2 release files

1.3.4

2 release files

1.2.1

2 release files

1.2.0

2 release files

0.1.10

2 release files

This release

0.1.9 This release

2 release files

0.1.8

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.3

2 release files

0.1.2

2 release files

0.1.1

2 release files

0.1.0

2 release files

0.0.8

2 release files

0.0.7

2 release files

0.0.6

2 release files

0.0.5

2 release files

0.0.4

2 release files

0.0.3

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page