Skip to main content

Convert between compass points 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:

import portolan

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

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

Convert to traditional names of the Mediterranean basin:

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

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

Convert between degrees and abbrevations:

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)

Release files for portolan 1.0.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for portolan 1.0.1
File Interpreter ABI Platform
portolan-1.0.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Release files / portolan-1.0.1-py2.py3-none-any.whl

Download URL portolan-1.0.1-py2.py3-none-any.whl
Size 5.0 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
4d20af64e8d8a771457a1e333754d70e8cd6a3f11b6dc75fbe3ec25d46fb457a
BLAKE2b-256 checksum
How to use checksums
184138a8d69aa4d790aae833b2f15cae36a59f3aeb1a9050dbc669e49b12e006
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

1.0.1 This release

1 release file

1.0

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page