Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

Boolean Expressions Interpreter

Project Description

Booleano is an interpreter of boolean expressions, a library to define and run filters available as text (e.g., in a natural language) or in Python code.

stable branche

development status

In order to handle text-based filters, Booleano ships with a fully-featured parser whose grammar is adaptive: Its properties can be overridden using simple configuration directives.

On the other hand, the library exposes a pythonic API for filters written in pure Python. These filters are particularly useful to build reusable conditions from objects provided by a third party library.


a string + some variable = safe boolean evaluation

# is this character a minor guy with a "0" in his name and born after 1983 ?
    'age < const:majority & "o" in name & birthdate > "1983-02-02"',
    {"name": "sokka", "age": 15, "birthdate":, 1, 1)},
    {'majority': 18},
    grammar_tokens={'belongs_to': 'in'}
) => True

The Fun Use Case

Booleano allow to safely evaluate an expression into something usable.

  • user:name is "john" and user:surname in {"doe", "shepard"}

+``{“user”: {“name”: “katara”}}`` => False +``{“user”: {“name”: “john”, “surname”: “doe”}}`` => True

with some code, you can provide any type you want, and the expression can still be in text:

+``user:birthdate > “03-07-1987”`` +``duration > 1m30s``

check the sample dirrectory to view more running examples !


The full documentation is at


this project was not created by the current maintainer. in fact, the knowlege of this project from us is fare from perfect, but with 100% of test coverages, it’s not hard to keep it running.

if you find a bug, or want some feature, feel free to create a issues, or a Pull Request, but keep in mind that it can be hard for us to work on it. the best way to have it fixed, it’s to write a Pull Request with passing tests, and we will merge it if it’s a good piece of code.

see CONTRIBUTING.rst to know how work with ease on this project.

Upgrade Note

the old alpha release 1.0a1 is not compatible with newer version (starting with 1.1a1) because of heavy import path changes. all import from the modules ( is discouraged.


forked from Gustavo Narea’s booleano project on

maintened by yupeek

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

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

Filename, Size & Hash SHA256 Hash Help File Type Python Version Upload Date
(54.9 kB) Copy SHA256 Hash SHA256
Wheel 3.5 Jun 6, 2017
(35.6 kB) Copy SHA256 Hash SHA256
Source None Jun 6, 2017

Supported By

Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Google Google Cloud Servers