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.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
Built Distributions
File details
Details for the file port-range-1.0.3.tar.gz
.
File metadata
- Download URL: port-range-1.0.3.tar.gz
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e902601b066eca78f39093d63833db1711c57f2c2661d17fad6fb1018e917dc7 |
|
MD5 | b83941bfbbd76f2ed41843a31dfbc8f8 |
|
BLAKE2b-256 | eec4691a61bfb37875619a40f449a82aed80cde9ee3cbda239b3d24a2305415b |
File details
Details for the file port_range-1.0.3-py2.7.egg
.
File metadata
- Download URL: port_range-1.0.3-py2.7.egg
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 67407064540be33a950ecb41eb6cde4f8555bb028dbedeb4d3eaf63e8952405e |
|
MD5 | 509e3376209bdc345d0bbbbf3e3b15cb |
|
BLAKE2b-256 | 2fbe02605a46f96a24ba9798ca6b8afe37a631549371f49c0accf90b32be5093 |
File details
Details for the file port_range-1.0.3-py2-none-any.whl
.
File metadata
- Download URL: port_range-1.0.3-py2-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | abb6b0e8f7437e0de24149f7dad8ecd34f1c6401065859e9f47850326f69712d |
|
MD5 | 94ae2fb9ba4f47ae93e17590be2c3ea2 |
|
BLAKE2b-256 | af22eb81c22855ce07e72119c2f88eea7ba4ab3fc9d15cffb89fdbd892ac18eb |