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 details)
Built Distributions
port_range-1.0.0-py2.7.egg
(5.8 kB
view details)
File details
Details for the file port-range-1.0.0.tar.gz
.
File metadata
- Download URL: port-range-1.0.0.tar.gz
- Upload date:
- Size: 6.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 90349a00be3c131a93316112bfa3c3ade23a1ef1fafba508c10677f6e0b2daa0 |
|
MD5 | f1bfd8855e664e088175f2b90a5c6a91 |
|
BLAKE2b-256 | b346569541fe543413cb63e6ac1fd803180cf9271881d8a7d5cd576079a37a69 |
File details
Details for the file port_range-1.0.0-py2.7.egg
.
File metadata
- Download URL: port_range-1.0.0-py2.7.egg
- Upload date:
- Size: 5.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8ebbd178adfe175c97879459550118fca767ee19636c929545033cd554f7e7a1 |
|
MD5 | 4cd477649ec5fc809f26ec4f4c7f40cd |
|
BLAKE2b-256 | 38db5620b61d155a6002915ddee0d21f2de90eace37d71d715549ca732ee21c5 |
File details
Details for the file port_range-1.0.0-py2-none-any.whl
.
File metadata
- Download URL: port_range-1.0.0-py2-none-any.whl
- Upload date:
- Size: 7.7 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8d797f3ef25fde86eceb2cbd0644b99f44f45dc430244429f9fcd375e6b160e6 |
|
MD5 | 749b75347f73b72da3bf4c929a548f24 |
|
BLAKE2b-256 | d760d9e55a30849d0efae27dac683cd9cfabfc19e8e9c38b23d5ccdacbab2e8b |