This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Port range with support of CIDR-like notation.

Stable release:

Development:

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'

Enforce strong validatation in strict mode:

>>> PortRange(' 4242-42 ', strict=True)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "port_range/__init__.py", line 62, in __init__
    self.port_from, self.port_to = self.parse(port_range)
  File "port_range/__init__.py", line 109, in parse
    raise ValueError("Invalid reversed port range.")
ValueError: Invalid reversed port range.

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.

Changes for v2.0.0 (2015-12-19)

  • Refactor parsing. Makes normal mode stricter and strict mode more rigorous.
  • Expose is_single_port and is_cidr properties in repr().
  • Unittests covers 100% of code.
  • Add default isort config.
  • Run unittests against Python 3.3, 3.5, 3.6-dev, 3.7-dev, PyPy2.7 and PyPy3.3.
  • Remove popularity badge: PyPI download counters are broken and no longer displayed.
  • Move coverage config to setup.cfg.
  • Add test and develop dependencies.
  • Only show latest changes in the long description of the package instead of the full changelog.
  • Replace pep8 package by pycodestyle.
  • Enforce pycodestyle checks in Travis CI jobs.
  • Test production of packages in Travis CI jobs.
  • Always check for package metadata in Travis CI jobs.
  • Make wheels generated under Python 2 environnment available for Python 3 too.
  • Add link to full changelog in package’s long description.

Full changelog.

Release History

Release History

2.0.0

This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.5

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.3

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.2

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.1

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

1.0.0

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
port_range-2.0.0-py2.7.egg (7.8 kB) Copy SHA256 Checksum SHA256 2.7 Egg Dec 19, 2016
port_range-2.0.0-py2.py3-none-any.whl (10.6 kB) Copy SHA256 Checksum SHA256 2.7 Wheel Dec 19, 2016
port-range-2.0.0.tar.gz (9.4 kB) Copy SHA256 Checksum SHA256 Source Dec 19, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting