A RetroSearch Logo

Home - News ( United States | United Kingdom | Italy | Germany ) - Football scores

Search Query:

Showing content from https://github.com/deepin-community/python-boolean.py below:

GitHub - deepin-community/python-boolean.py

"boolean.py" is a small library implementing a boolean algebra. It defines two base elements, TRUE and FALSE, and a Symbol class that can take on one of these two values. Calculations are done in terms of AND, OR and NOT - other compositions like XOR and NAND are not implemented but can be emulated with AND or and NOT. Expressions are constructed from parsed strings or in Python.

It runs on Python 3.6+ You can use older version 3.x for Python 2.7+ support.

https://github.com/bastikr/boolean.py

Build status:

>>> import boolean
>>> algebra = boolean.BooleanAlgebra()
>>> expression1 = algebra.parse(u'apple and (oranges or banana) and not banana', simplify=False)
>>> expression1
AND(Symbol('apple'), OR(Symbol('oranges'), Symbol('banana')), NOT(Symbol('banana')))

>>> expression2 = algebra.parse('(oranges | banana) and not banana & apple', simplify=True)
>>> expression2
AND(Symbol('apple'), NOT(Symbol('banana')), Symbol('oranges'))

>>> expression1 == expression2
False
>>> expression1.simplify() == expression2
True

http://readthedocs.org/docs/booleanpy/en/latest/

To install boolean.py, you need to have the following pieces of software on your computer:

You then only need to run the following command:

pip install boolean.py

Installation via package managers

There are packages available for easy install on some operating systems. You are welcome to help us package this tool for more distributions!

In particular:

Test boolean.py with your current Python environment:

python setup.py test

Test with all of the supported Python environments using tox:

pip install -r requirements-dev.txt
tox

If tox throws InterpreterNotFound, limit it to python interpreters that are actually installed on your machine:

tox -e py36

Alternatively use pytest.

Copyright (c) Sebastian Kraemer, basti.kr@gmail.com and others SPDX-License-Identifier: BSD-2-Clause


RetroSearch is an open source project built by @garambo | Open a GitHub Issue

Search and Browse the WWW like it's 1997 | Search results from DuckDuckGo

HTML: 3.2 | Encoding: UTF-8 | Version: 0.7.4