跳转到主要内容

在罗盘点和度之间转换

项目描述

罗盘点和度之间转换。这是一个无依赖项的超小库。

pip install portolan

方法

只有几个:pointtraditionaldegreesmiddlerange

示例

将缩写或十进制度数转换为罗盘点

import portolan

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

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

转换为地中海盆地的传统名称

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

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

在度数和缩写之间转换

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)

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码发行版

此版本没有可用的源代码发行版文件。请参阅生成发行版存档的教程

构建发行版

portolan-1.0.1-py2.py3-none-any.whl (5.0 kB 查看哈希值)

上传于 Python 2 Python 3