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
Built Distributions
File details
Details for the file port-range-1.0.5.tar.gz
.
File metadata
- Download URL: port-range-1.0.5.tar.gz
- Upload date:
- Size: 6.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 008adbcbb1e0c3dfd43915f6dde296588d3ea76ad5ad43e10c8de528510aabf2 |
|
MD5 | 6b8f85601f36ebfe9d1203c701811b31 |
|
BLAKE2b-256 | 34afb3609612ab8b67479c717d5e3df36968a5402759ac3932f14a92d5fc16c7 |
File details
Details for the file port_range-1.0.5-py2.7.egg
.
File metadata
- Download URL: port_range-1.0.5-py2.7.egg
- Upload date:
- Size: 6.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3099ee1cf65e0ebf4be1394a8b51afdeaaac281b2b5334490041abec528454d6 |
|
MD5 | 924c85f8e3c2229c926ea6733dd289d7 |
|
BLAKE2b-256 | 51b6040b6c0264b149aa21462e7ff8db0ca0ede36250688a874f720830d55b78 |
File details
Details for the file port_range-1.0.5-py2-none-any.whl
.
File metadata
- Download URL: port_range-1.0.5-py2-none-any.whl
- Upload date:
- Size: 8.9 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 454676f018e5c38524d8e3bf08d90d5f94b85e053c3516b3eef0fa009d4bd1ce |
|
MD5 | cbeb7535e8750dc8229fbb97b0a9c6cd |
|
BLAKE2b-256 | 329a79d15a7bdf41353733e9a98087600deb0d40310a0e920bd9742b87e8aea5 |