updates
This commit is contained in:
@@ -0,0 +1,140 @@
|
||||
|
||||
Changelog
|
||||
=========
|
||||
|
||||
|
||||
next
|
||||
----
|
||||
|
||||
5.0 (2025-04-03)
|
||||
----------------
|
||||
|
||||
* API changes
|
||||
|
||||
* Drop support for Python versions older than 3.9.
|
||||
* Add support by testing on Python 3.11 to 3.14
|
||||
* Fix absorption issues https://github.com/bastikr/boolean.py/issues/111 and
|
||||
https://github.com/bastikr/boolean.py/issues/112
|
||||
|
||||
|
||||
|
||||
4.0 (2022-05-05)
|
||||
----------------
|
||||
|
||||
* API changes
|
||||
|
||||
* Drop support for Python 2.
|
||||
* Test on Python 3.10
|
||||
* Make Expression.sort_order an instance attributes and not a class attribute
|
||||
|
||||
* Misc.
|
||||
|
||||
* Correct licensing documentation
|
||||
* Improve docstringf and apply minor refactorings
|
||||
* Adopt black code style and isort for imports
|
||||
* Drop Travis and use GitHub actions for CI
|
||||
|
||||
|
||||
3.8 (2020-06-10)
|
||||
----------------
|
||||
|
||||
* API changes
|
||||
|
||||
* Add support for evaluation of boolean expression.
|
||||
Thank you to Lars van Gemerden @gemerden
|
||||
|
||||
* Bug fixes
|
||||
|
||||
* Fix parsing of tokens that have a number as the first character.
|
||||
Thank you to Jeff Cohen @ jcohen28
|
||||
* Restore proper Python 2 compatibility.
|
||||
Thank you to Benjy Weinberger @benjyw
|
||||
|
||||
* Improve documentation
|
||||
|
||||
* Add pointers to Linux distro packages.
|
||||
Thank you to Max Mehl @mxmehl and Carmen Bianca Bakker @carmenbianca
|
||||
* Fix typo.
|
||||
Thank you to Gabriel Niebler @der-gabe
|
||||
|
||||
|
||||
3.7 (2019-10-04)
|
||||
----------------
|
||||
|
||||
* API changes
|
||||
|
||||
* Add new sort argument to simplify() to optionally not sort when simplifying
|
||||
expressions (e.g. not applying "commutativity"). Thank you to Steven Esser
|
||||
@majurg for this
|
||||
* Add new argument to tokenizer to optionally accept extra characters in symbol
|
||||
tokens. Thank you to @carpie for this
|
||||
|
||||
|
||||
3.6 (2018-08-06)
|
||||
----------------
|
||||
|
||||
* No API changes
|
||||
|
||||
* Bug fixes
|
||||
|
||||
* Fix De Morgan's laws effect on double negation propositions. Thank you to Douglas Cardoso for this
|
||||
* Improve error checking when parsing
|
||||
|
||||
|
||||
3.5 (Nov 1, 2017)
|
||||
-----------------
|
||||
|
||||
* No API changes
|
||||
|
||||
* Bug fixes
|
||||
|
||||
* Documentation updates and add testing for Python 3.6. Thank you to Alexander Lisianoi @alisianoi
|
||||
* Improve testng and expression equivalence checks
|
||||
* Improve subs() method to an expression
|
||||
|
||||
|
||||
|
||||
3.4 (May 12, 2017)
|
||||
------------------
|
||||
|
||||
* No API changes
|
||||
|
||||
* Bug fixes and improvements
|
||||
|
||||
* Fix various documentation typos and improve tests . Thank you to Alexander Lisianoi @alisianoi
|
||||
* Fix handling for literals vs. symbols in negations Thank you to @YaronK
|
||||
|
||||
|
||||
3.3 (2017-02-09)
|
||||
----------------
|
||||
|
||||
* API changes
|
||||
|
||||
* #40 and #50 Expression.subs() now takes 'default' thanks to @kronuz
|
||||
* #45 simplify=False is now the default for parse and related functions or methods.
|
||||
* #40 Use "&" and "|" as default operators
|
||||
|
||||
* Bug fixes
|
||||
|
||||
* #60 Fix bug for "a or b c" which is not a valid expression
|
||||
* #58 Fix math formula display in docs
|
||||
* Improve handling of parse errors
|
||||
|
||||
|
||||
2.0.0 (2016-05-11)
|
||||
------------------
|
||||
|
||||
* API changes
|
||||
|
||||
* New algebra definition. Refactored class hierarchy. Improved parsing.
|
||||
|
||||
* New features
|
||||
|
||||
* possibility to subclass algebra definition
|
||||
* new normal forms shortcuts for DNF and CNF.
|
||||
|
||||
|
||||
1.1 (2016-04-06)
|
||||
------------------
|
||||
|
||||
* Initial release on Pypi.
|
||||
@@ -0,0 +1,23 @@
|
||||
Copyright (c) Sebastian Kraemer, basti.kr@gmail.com and others
|
||||
All rights reserved.
|
||||
|
||||
Redistribution and use in source and binary forms, with or without modification,
|
||||
are permitted provided that the following conditions are met:
|
||||
|
||||
1. Redistributions of source code must retain the above copyright notice, this
|
||||
list of conditions and the following disclaimer.
|
||||
|
||||
2. Redistributions in binary form must reproduce the above copyright notice,
|
||||
this list of conditions and the following disclaimer in the documentation and/or
|
||||
other materials provided with the distribution.
|
||||
|
||||
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
|
||||
ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
|
||||
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
|
||||
DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR
|
||||
ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
|
||||
(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
|
||||
LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
|
||||
ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
|
||||
(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
|
||||
SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
|
||||
@@ -0,0 +1,114 @@
|
||||
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: |Build Status|
|
||||
|
||||
|
||||
Example
|
||||
-------
|
||||
|
||||
::
|
||||
|
||||
>>> 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
|
||||
|
||||
|
||||
Documentation
|
||||
-------------
|
||||
|
||||
http://readthedocs.org/docs/booleanpy/en/latest/
|
||||
|
||||
|
||||
Installation
|
||||
------------
|
||||
|
||||
Installation via pip
|
||||
~~~~~~~~~~~~~~~~~~~~
|
||||
|
||||
To install boolean.py, you need to have the following pieces of software
|
||||
on your computer:
|
||||
|
||||
- Python 3.6+
|
||||
- pip
|
||||
|
||||
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!
|
||||
|
||||
- boolean.py has been packaged as Arch Linux, Fedora, openSus,
|
||||
nixpkgs, Guix, DragonFly and FreeBSD
|
||||
`packages <https://repology.org/project/python:boolean.py/versions>`__ .
|
||||
|
||||
In particular:
|
||||
|
||||
- Arch Linux (AUR):
|
||||
`python-boolean.py <https://aur.archlinux.org/packages/python-boolean.py/>`__
|
||||
- Fedora:
|
||||
`python-boolean.py <https://apps.fedoraproject.org/packages/python-boolean.py>`__
|
||||
- openSUSE:
|
||||
`python-boolean.py <https://software.opensuse.org/package/python-boolean.py>`__
|
||||
|
||||
|
||||
Testing
|
||||
-------
|
||||
|
||||
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.
|
||||
|
||||
|
||||
License
|
||||
-------
|
||||
|
||||
Copyright (c) Sebastian Kraemer, basti.kr@gmail.com and others
|
||||
SPDX-License-Identifier: BSD-2-Clause
|
||||
|
||||
.. |Build Status| image:: https://travis-ci.org/bastikr/boolean.py.svg?branch=master
|
||||
:target: https://travis-ci.org/bastikr/boolean.py
|
||||
Reference in New Issue
Block a user