Metadata-Version: 2.0
Name: port-range
Version: 1.0.5
Summary: Port range with support of CIDR-like notation
Home-page: http://github.com/scaleway/port-range
Author: Scaleway
Author-email: opensource@scaleway.com
License: BSD
Platform: UNKNOWN
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: BSD License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Networking

port-range
==========

Port range with support of CIDR-like notation.

Stable release: |release| |license| |dependencies| |popularity|

Development: |build| |quality| |coverage|

.. |release| image:: https://img.shields.io/pypi/v/port-range.svg?style=flat
    :target: https://pypi.python.org/pypi/port-range
    :alt: Last release
.. |license| image:: https://img.shields.io/pypi/l/port-range.svg?style=flat
    :target: http://opensource.org/licenses/BSD-2-Clause
    :alt: Software license
.. |popularity| image:: https://img.shields.io/pypi/dm/port-range.svg?style=flat
    :target: https://pypi.python.org/pypi/port-range#downloads
    :alt: Popularity
.. |dependencies| image:: https://img.shields.io/requires/github/scaleway/port-range/master.svg?style=flat
    :target: https://requires.io/github/scaleway/port-range/requirements/?branch=master
    :alt: Requirements freshness
.. |build| image:: https://img.shields.io/travis/scaleway/port-range/develop.svg?style=flat
    :target: https://travis-ci.org/scaleway/port-range
    :alt: Unit-tests status
.. |coverage| image:: https://codecov.io/github/scaleway/port-range/coverage.svg?branch=develop
    :target: https://codecov.io/github/scaleway/port-range?branch=develop
    :alt: Coverage Status
.. |quality| image:: https://img.shields.io/scrutinizer/g/scaleway/port-range.svg?style=flat
    :target: https://scrutinizer-ci.com/g/scaleway/port-range/?branch=develop
    :alt: Code Quality


Features
--------

Support CIDR-like notation:

.. code-block:: python

    >>> 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:

.. code-block:: python

    >>> pr = PortRange(' 4242-42 ')
    >>> pr.bounds
    (42, 4242)
    >>> str(pr)
    '42-4242'

Access to decimal-representation properties:

.. code-block:: python

    >>> 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`_.

.. _BSD 2-Clause License: https://github.com/scaleway/port-range/blob/develop/LICENSE.rst

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.


