geokits
海事地理计算库
港口属性判定(PortAttrs)
给定港口经纬度,一步算出全部管辖属性——建港时只需经纬度和名称:
from geokits import PortAttrs
pa = PortAttrs() # 进程内建一个实例反复用(构造即加载内嵌边界,~毫秒级)
pa.lookup(121.5, 31.4)
# {'zone_name': 'North China & Far East', 'is_eu_mrv': False,
# 'is_fueleu_exclude': False, 'continent': 'ASIA'}
| 字段 | 类型 | 说明 |
|---|---|---|
zone_name |
str | None |
海区名(12 海区词表,与 port.zone_name 一致) |
is_eu_mrv |
bool |
是否在 EU MRV 管辖边界内 |
is_fueleu_exclude |
bool |
是否属 FuelEU 豁免区域(挪威/冰岛) |
continent |
str | None |
大洲(大写下划线词表:ASIA/EUROPE/…) |
- 边界多边形内嵌于 crate(
data/*.geojson),无需外部数据源、无网络请求;单次 lookup 微秒级 pa.data_version返回边界数据版本(YYYYMMDD),用于排查新旧不一致- 实例无状态、线程安全,可全局共享
编译
maturin develop --release
区域价格查询(PriceQuery)
两个经纬度 + via 码 → 报价。内部自动判定两点所在海区(zone),再查 zone×zone×via 价格表:
import geokits
pq = geokits.PriceQuery()
pq.price(4.4, 51.9, -74.0, 40.7, "DIR") # 鹿特丹 → 纽约,直航
# {'departure': 'Europe', 'destination': 'North America East Coast',
# 'via': 'DIR', 'amount': 600.0}
pq.price(121.5, 31.4, 4.4, 51.9, "SUE") # 上海 → 鹿特丹,走苏伊士
pq.via_codes # ['CGH', 'CHC', 'DIR', 'PMP', 'SGP', 'SUE']
- 无匹配条目(zone 组合或 via 不在表内)返回
None via大小写不敏感;via 码含义(PASS_VIA 枚举):DIR 直航 / SUE 苏伊士运河 / PAN(PMP) 巴拿马运河 / CGH 好望角 / CHC(CHO) 合恩角 / SGP 新加坡
Metadata
Release files for geokits 0.5.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Built distributions (wheels)
| File | Actions Reset | |||
|---|---|---|---|---|
| geokits-0.5.1-cp312-cp312-win_amd64.whl | CPython 3.12 | CPython 3.12 | Windows x86-64 | Details for geokits-0.5.1-cp312-cp312-win_amd64.whl |
| geokits-0.5.1-cp312-cp312-manylinux_2_34_x86_64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.34+ x86-64 | Details for geokits-0.5.1-cp312-cp312-manylinux_2_34_x86_64.whl |
| geokits-0.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl | CPython 3.12 | CPython 3.12 | Linux glibc 2.17+ ARM64 | Details for geokits-0.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
| geokits-0.5.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl | CPython 3.12 | CPython 3.12 | macOS 10.12+ x86-64, macOS 11.0+ ARM64, macOS 10.12+ universal2 (ARM64, x86-64) | Details for geokits-0.5.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
Total release size: 1.3 MB
Release files / geokits-0.5.1-cp312-cp312-win_amd64.whl
| Download URL | geokits-0.5.1-cp312-cp312-win_amd64.whl |
|---|---|
| Size | 190.4 kB |
| Tags | CPython 3.12 Windows x86-64 |
|
SHA-256 checksum How to use checksums |
fa9fb406423f8d9decdfac0ae1db2e3614be5e4bb3270a4893781995b7d3355e
|
|
BLAKE2b-256 checksum How to use checksums |
fc59282753a1f07cfd3ec14f113ca8aee0cf04bad725cbe122aa18fc9caeb6e7
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / geokits-0.5.1-cp312-cp312-manylinux_2_34_x86_64.whl
| Download URL | geokits-0.5.1-cp312-cp312-manylinux_2_34_x86_64.whl |
|---|---|
| Size | 293.1 kB |
| Tags | CPython 3.12 Linux glibc 2.34+ x86-64 |
|
SHA-256 checksum How to use checksums |
e5ecf4a44eed66bdc0bd761faf22f9c1782f089652f041fedda57af02ccfa179
|
|
BLAKE2b-256 checksum How to use checksums |
f58a981ee56b735d86c34edd3ec386b3d5bf2c7a500a0f67ad915c1368307792
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / geokits-0.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | geokits-0.5.1-cp312-cp312-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 275.5 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 |
|
SHA-256 checksum How to use checksums |
902d8f4bfc9c9c7e5b85183d2cfa38297fb4e091f028320f9f991d92484f47b4
|
|
BLAKE2b-256 checksum How to use checksums |
7a585bcd9b3d45ca31673e3ae298f058dca47f17717927f790ef9ff006bb7232
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / geokits-0.5.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl
| Download URL | geokits-0.5.1-cp312-cp312-macosx_10_12_x86_64.macosx_11_0_arm64.macosx_10_12_universal2.whl |
|---|---|
| Size | 497.0 kB |
| Tags | CPython 3.12 macOS 10.12+ universal2 (ARM64, x86-64) macOS 10.12+ x86-64 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
783dc2abdaa90173bb67ab9b83e0ff24943d205aa38305f9ca4d802fc4edabbd
|
|
BLAKE2b-256 checksum How to use checksums |
869a42e4e583905f2201d4ec0e0ae903204d3cb333ef6672bb2982279e52181a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.2 {"installer":{"name":"uv","version":"0.11.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for geokits 0.5.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.