Skip to main content

A simple python based expression language

Project description


Brabbel is a small python based expression language which can be used to
evaluate simple expressions.

Brabbel provides the following set of features:

* Values: Strings, Numbers, Variables , Lists
* simple arithmetic operations: + - / *
* simple equation : < > <= >= == !=
* simple bool operation: and or not
* function calls: date, bool
* other: check if values is _in_ a list

Brabbel is the german term for the first "language" of a baby and emphasises
the reduced coverage of this language.
- Added float function to cast value to float. Used to make comparisions
between float and int possible.

- Improved parsing single quoted strings. Now almost all chars are allowed
except a single quote "'" will will raise an execption because parsing
fails. Because the fix is a improvement at all and the remaining bug is is
currently considered as a rare corner case. This will be released anyway.

- Added workaround for failing parsing of expressions when pyparsing is under
high load.

- Changed license from MIT to GPL v2+ and added LICENSE.txt
- Added "bdist_rpm" section setup.cfg.
- Added "egg_info" section setup.cfg.

- Make comparison of operators more type safe. Evaluation of terms is only
valid of operators of the same type. Otherwise the term will evaluate to
- Implement short circuiting for "and" and "or" operators.
- Support "True","False","None" in bool function.
- Refactored code. Created own module for operators and functions.
- Added documentation.

Make Brabbel Python3 compatible. Added python-future package as dependency

- Allow dots "." in variable names.

- Fixed handling of integer and string values in lists.

- Added folders for documentation (currently empty)
- Allow "-" in Strings
- Added more tests.

- Log warning if a variable can not be resolved in the values dict.
- Allow signed numbers. Currently only negativ sign is allowed.
- String to not have a "'" anymore.
- Added more tests.

- Compatiblity: Allow "-" in variable names.
- Fixed strip of "'" in "len" function.

- Allow empty strings
- Fix bool function
- Allow lists as param for functions

- Added len function

- Be more tolerant on whitespaces in delimeted lists,
- Fix call of functions

- Add operator mapping for operators like ge, gt, le, lt, eq, ne
- Be more tolerant on getting non existing values from the values dictionary.
- Removed Rule class.

- Initial Release

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

brabbel-0.4.4.tar.gz (8.1 kB view hashes)

Uploaded source

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page