Port range with support of CIDR-like notation
Project description
port-range
Port range with support of CIDR-like notation.
Features
Support CIDR-like notation:
>>> from port_range import PortRange
>>> pr = PortRange('1027/15')
>>> pr.port_from
1027
>>> pr.port_to
1028
>>> pr.bounds
(1027, 1028)
Parse and normalize port ranges:
>>> pr = PortRange(' 4242-42 ')
>>> pr.bounds
(42, 4242)
>>> str(pr)
'42-4242'
Access to decimal-representation properties:
>>> pr = PortRange('1027/15')
>>> pr.base
1027
>>> pr.prefix
15
>>> pr.mask
1
>>> pr.offset
3
License
This software is licensed under the BSD 2-Clause License.
ChangeLog
1.0.5 (2015-11-23)
Add bumpversion config.
1.0.4 (2015-11-23)
Switch from coveralls.io to codecov.io.
1.0.3 (2015-04-10)
Raise exception when trying to render non-CIDR-like port ranges with a CIDR notation.
1.0.2 (2015-04-07)
Update all Online Labs references to Scaleway.
1.0.1 (2015-03-26)
Check code coverage thanks to coveralls.
1.0.0 (2014-12-11)
Split out port range helpers into its own stand-alone package.
First public release.
0.1.0 (2014-02-17)
First internal release.
0.0.0 (2014-02-11)
First commit.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
port-range-1.0.5.tar.gz
(6.8 kB
view hashes)
Built Distributions
port_range-1.0.5-py2.7.egg
(6.5 kB
view hashes)
Close
Hashes for port_range-1.0.5-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 454676f018e5c38524d8e3bf08d90d5f94b85e053c3516b3eef0fa009d4bd1ce |
|
MD5 | cbeb7535e8750dc8229fbb97b0a9c6cd |
|
BLAKE2b-256 | 329a79d15a7bdf41353733e9a98087600deb0d40310a0e920bd9742b87e8aea5 |