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.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.2.tar.gz
(6.4 kB
view details)
Built Distributions
port_range-1.0.2-py2.7.egg
(6.1 kB
view details)
File details
Details for the file port-range-1.0.2.tar.gz
.
File metadata
- Download URL: port-range-1.0.2.tar.gz
- Upload date:
- Size: 6.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 29a108b246e391ac8e0edefffc8f69902aa0e0e97d6f50556a79c22ed80e0c0f |
|
MD5 | 6f936ff30d91137f3c62636fc077ec0c |
|
BLAKE2b-256 | 3688a004e5a686c059dace7f199ade831c75f1ca69ca22e96fbbcfc2c5be2be6 |
File details
Details for the file port_range-1.0.2-py2.7.egg
.
File metadata
- Download URL: port_range-1.0.2-py2.7.egg
- Upload date:
- Size: 6.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 670ff0cb5598b39f637046d0befda4bf23c1a83dc4e1e34e46aada8814611a24 |
|
MD5 | 32d1b7a0080db2c5eb841c43a29cc5e9 |
|
BLAKE2b-256 | 9526039e00e8e10686aa385275e2242d7acbff19faa31ea097f688fb3ce926a8 |
File details
Details for the file port_range-1.0.2-py2-none-any.whl
.
File metadata
- Download URL: port_range-1.0.2-py2-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 437104d6ea2cd3dbee981971a0bd9aaa59c8219aa4c1c251175cdb35cf32b5c8 |
|
MD5 | 55117fb3e2797e8cca892c86815ead23 |
|
BLAKE2b-256 | 1342213072d7e489823cf51d98d8cc84ac1150e6c2aaf65f388cd804890d14a5 |