Pyinter
Pyinter is a small and simple library written in Python for performing interval and discontinous range arithmetic.
>>> pyinter.openclosed(1.1, 12)
(1.1, 12]
>>> discontinous_range = pyinter.IntervalSet([pyinter.closedopen(5, 10), pyinter.closed(22, 23)])
>>> discontinous_range
IntervalSet([5, 10), [22, 23])
>>> 7 in discontinous_range
True
>>> 10 in discontinous_range
False # This isn't in the range as it is an open interval which doesn't include its end points
Features
interval objects which can be
unioned
intersected
easily constructed using helper functions: open, closed, openclosed and closedopen
interval sets which can be
unioned
intersected
Installation
To install Pyinter, simply:
$ pip install pyinter
Or, if you absolutely must:
$ easy_install pyinter
But I’m told you really shouldn’t do that.
Documentation
Documentation is available at http://pyinter.readthedocs.org.
Contribute
Contributions or suggestions for improvements are welcome.
Release History
0.2.0 (2019-05-14)
Fix: The interval of 2 identical numbers equals the empty set if one of the boundaries is open #20
Improvement: Add lower and upper properties and replace method which works similarly to date.replace #19
0.1.9 (2015-08-01)
Fix empty interval types so that empty intervals could be compared with other intervals
Add method copy() to create new Interval instances with the same bounds and values as the Interval being copied
Fix method overlaps on Interval and add tests for it!
0.1.8 (2015-07-14)
Fix formatting in README.rst as pypi isn’t rendering it properly.
0.1.7 (2015-07-14)
Fix | and & in the documentation.
Implement subtraction of Interval’s and IntervalSet’s
Add method empty() to detect empty Interval objects.
Fix, each infinity should always equal itself.
0.1.6 (2014-05-11)
Add a complement function
Fix bug with using & and | for union() and intersection()
Increase test coverage!
0.1.5 (2013-12-13)
Fix the __all__ list so that you can from pyinter import *.
Change classes to new style classes (inheriting from object)
Added an add() function to the IntervalSet class. This will add (union) an Interval inplace. (similarly to set().add())
The optional iterable of Interval objects passed when initialising an IntervalSet is now added Interval by Interval so that initialising with overlapping intervals works as expected.
0.1.4 (2013-11-16)
Fix formatting in HISTORY.rst which was stopping the pypi page rendering it.
0.1.3 (2013-11-16)
Removed *.md from the MANIFEST file as it warns when installing that no files matching *.md are found.
Fix allowing an IntervalSet to be initialised with a generator.
0.1.2 (2013-10-12)
Fixed the rendering of the README on pypi (hopefully!) by converting it from a .md file to a .rst file.
0.1.1 (2013-10-09)
Adding Manifest file to fix the pypi release. This was broken because the README.md was not being included in the source distribution but setup.py had a reference to this file and therefore failed to run.
0.1.0 (2013-07-03)
Initial release
Metadata
Release files for pyinter 0.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| pyinter-0.2.0.tar.gz | 20.3 kB | Without provenance | Details for pyinter-0.2.0.tar.gz |
Release files / pyinter-0.2.0.tar.gz
| Download URL | pyinter-0.2.0.tar.gz |
|---|---|
| Size | 20.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
c0c1717bef2b8c781776f97861133b27224d558169aa4bd2845d26868d7957bd
|
|
BLAKE2b-256 checksum How to use checksums |
3b291c8a681f14ace0adc782064af97e2476c80e01ee14f570dec6f1b66f869b
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
Python-urllib/3.6
|
Security for pyinter 0.2.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.