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.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.0.tar.gz
(6.2 kB
view hashes)
Built Distributions
port_range-1.0.0-py2.7.egg
(5.8 kB
view hashes)
Close
Hashes for port_range-1.0.0-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d797f3ef25fde86eceb2cbd0644b99f44f45dc430244429f9fcd375e6b160e6 |
|
MD5 | 749b75347f73b72da3bf4c929a548f24 |
|
BLAKE2b-256 | d760d9e55a30849d0efae27dac683cd9cfabfc19e8e9c38b23d5ccdacbab2e8b |