Metadata-Version: 2.0
Name: portolan
Version: 1.0.1
Summary: Convert between compass points and degrees
Home-page: https://github.com/fitnr/portolan
Author: Neil Freeman
Author-email: contact@fakeisthenewreal.org
License: GPL
Platform: UNKNOWN
Classifier: License :: OSI Approved :: GNU General Public License v3 (GPLv3)
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Topic :: Scientific/Engineering :: Atmospheric Science
Classifier: Intended Audience :: Science/Research

Portolan
========

Convert between `compass
points <https://en.wikipedia.org/wiki/Points_of_the_compass>`__ and
degrees. It's a super tiny library with no dependencies.

::

    pip install portolan

Methods
-------

Just a few: ``point``, ``traditional``, ``degrees``, ``middle``,
``range``.

Examples
--------

Convert from abbreviations or a decimal degree to the compass point:

.. code:: python

    import portolan

    portolan.point(abbr='nnw')
    # 'north-northwest'

    portolan.point(degree=275.1)
    # 'west'

Convert to traditional names of the Mediterranean basin:

.. code:: python

    portolan.traditional(degree=12.6)
    # 'Quarto di Tramontana verso Greco'

    portolan.traditional(abbr='NEbE')
    # 'Quarto di Greco verso Levante'

Convert between degrees and abbrevations:

.. code:: python

    portolan.abbr(145.0)
    # 'SEbS'

    portolan.middle('SEbS')
    # 146.25

    portolan.range('SEbS')
    # (140.625, 151.875)

    # Remember that North spans the origin
    portolan.range('n')
    # (354.375, 5.625)

    # the degrees method returns the minimum, middle, and maximum of a compass point
    portolan.degrees('SEbS')
    # (140.625, 146.25, 151.875)



