Skip to main content

Convert between compass points and degrees

Project description

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)

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

portolan-1.0.tar.gz (3.0 kB view details)

Uploaded Source

Built Distribution

portolan-1.0-py2-none-any.whl (4.9 kB view details)

Uploaded Python 2

File details

Details for the file portolan-1.0.tar.gz.

File metadata

  • Download URL: portolan-1.0.tar.gz
  • Upload date:
  • Size: 3.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for portolan-1.0.tar.gz
Algorithm Hash digest
SHA256 64a188c76927b1c2b674f12fc0a893e07b3da274269dccb62f11084962e61e20
MD5 51eb0fa03d35c395fb0f048857c9f0d3
BLAKE2b-256 32e8085b46ef42a5b03776249ef981c56a208ec63d62d99c5cf5f0e16dbd54dc

See more details on using hashes here.

File details

Details for the file portolan-1.0-py2-none-any.whl.

File metadata

File hashes

Hashes for portolan-1.0-py2-none-any.whl
Algorithm Hash digest
SHA256 9c8cf5fdb9513f4d3d7c8a334a708e34cea502ec6774d3126d4f5f048f4f573c
MD5 4b0117f65e55c52063eb625cbd86369c
BLAKE2b-256 dabf3c9dfdf387fbc43f5b925d1e00c904c5a58cdd1053f9a56b790f7f1870bf

See more details on using hashes here.

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