Skip to main content

Port range with support of CIDR-like notation

Project description

port-range

Port range with support of CIDR-like notation.

Last release Unit-tests status Requirements freshness Software license Popularity

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 hashes)

Uploaded Source

Built Distributions

port_range-1.0.0-py2.7.egg (5.8 kB view hashes)

Uploaded Source

port_range-1.0.0-py2-none-any.whl (7.7 kB view hashes)

Uploaded Python 2

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page