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.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.1.tar.gz
(6.3 kB
view details)
Built Distributions
port_range-1.0.1-py2.7.egg
(6.0 kB
view details)
File details
Details for the file port-range-1.0.1.tar.gz
.
File metadata
- Download URL: port-range-1.0.1.tar.gz
- Upload date:
- Size: 6.3 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 4d9b226c7617450c9c14bac1dc5aab41b44a5acac34328fe3525b8a17184a39a |
|
MD5 | 2bc2f04c11f1e4e14b35902666dcb1b9 |
|
BLAKE2b-256 | 9e07fccb44255612672568e4c1b2b15786368b5157fdd52bfab052c4c4d92580 |
File details
Details for the file port_range-1.0.1-py2.7.egg
.
File metadata
- Download URL: port_range-1.0.1-py2.7.egg
- Upload date:
- Size: 6.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d4fb4e2cce892e4d45e7c546917bb3f95432c281e79b5ba45eba131353cf25fc |
|
MD5 | 39ca92c518c377e0e6c4db073dc1e814 |
|
BLAKE2b-256 | 7cb47fe33e535bb0f08cb31f80fe6e5f5ab6bb2f8d27426c7fd7b0d2cbb261db |
File details
Details for the file port_range-1.0.1-py2-none-any.whl
.
File metadata
- Download URL: port_range-1.0.1-py2-none-any.whl
- Upload date:
- Size: 8.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 9e0cf460f7791d537e84ef6fba83b0c82b61201667dbf504feb17b1b92c4d4e9 |
|
MD5 | dcfe5abd5058524b87901832823fdefb |
|
BLAKE2b-256 | 654f8be988c58165b5730632feeb3f3eafff7a04e91b4b231b553dc5276ea7a8 |