Metadata-Version: 2.1
Name: set-algebra
Version: 0.3.2
Summary: Algebra of Sets
Home-page: https://github.com/blackelk/set_algebra
Author: Constantine Parkhimovich
Author-email: cparkhimovich@gmail.com
License: MIT
Keywords: math set interval
Platform: UNKNOWN
Classifier: Development Status :: 4 - Beta
Classifier: Intended Audience :: Developers
Classifier: Natural Language :: English
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.2
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: Programming Language :: Python :: 3.6
Classifier: Topic :: Software Development :: Libraries :: Python Modules

Algebra of Sets in Python
=================================

| How to have a set containing all real numbers from 1 to 10 not including 10?
| How to add interval from 20 to 30 to the set?
| How to make sure this set is a subset of set of positive numbers?
| How to add scalar number to it?
| How to get complement of the set?

.. code:: python

    >>> from set_algebra import Interval, Set
    >>> s = Set('[1, 10)')
    >>> 1 in s
    True
    >>> 10 in s
    False
    >>> s.add(Interval('[20, 30]'))
    >>> 25 in s
    True
    >>> s <= Set('(0, inf)')
    True
    >>> s.add(100)
    >>> s.notation
    '[1, 10), [20, 30], {100}'
    >>> (~s).notation
    '(-inf, 1), [10, 20), (30, 100), (100, inf)'

Set-Algebra provides classes representing math concepts:

- Infinity
- Endpoint
- Interval
- Uncountable Infinite Set

Besides numbers, Set-Algebra supports all objects that can be compared to each other - strings, datetimes, etc.

Infinity() is greater than any of these objects except float('inf') and float('nan').
NegativeInfinity included as well.


Set-Algebra fully supports Python3. Tested on python 2.7, 3.2 - 3.6.



