Skip to main content

superwings-spinel

Find the nearest airport from (lat, lng) coordinates — the superwings API, computed by a Ruby port of the airport_finder crate compiled to native code by Spinel, Matz's Ruby AOT compiler.

from superwings_spinel import AirportSet, airport, country_at, find_nearest_airport

find_nearest_airport(37.5665, 126.978)
# {'code': 'kr.gmp', 'name': 'Seoul, Korea'}

country_at(-29.31, 27.48)
# 'ls'

hubs = AirportSet(["HYD", "BOM", "BCN"])
hubs.resolve(17.385, 78.486, foreign_max_km=300)
# {'code': 'in.hyd', 'iata': 'HYD', 'name': 'Hyderabad, India', ...,
#  'distance_km': 18.09828547178263, 'resolution': 'same_country', 'nearest_code': 'in.bpm'}
hubs.nearest(19.07, 72.87, country="IN", limit=2)

Functions, dicts and errors are superwings 0.3.0's: import superwings_spinel as superwings is enough to switch. The answers are the crate's, bit for bit on 150,403 test points, with one difference from superwings 0.3.0, which bundles the crate's 0.3.1: an enclave is its own country. Maseru is Lesotho (ls), not South Africa; 0.3.1 answered za across all of Lesotho.

Speed

The Rust wheel is faster: from Python a call takes 8–12 µs here against superwings' 4–5 µs, of which the ctypes and JSON round trip is a share. Loading the data on the first call takes about 35 ms.

Notes

  • The library takes one call at a time; the module serializes calls from threads with a lock.
  • Wheels carry no Python extension (the library is loaded with ctypes), so one wheel per platform serves every Python 3.9+. Elsewhere the sdist builds with a C compiler alone.
  • $SUPERWINGS_SPINEL_LIB points the module at another build of the library.

License

MIT. The library includes Spinel's runtime (MIT); see THIRD_PARTY_NOTICES.

Metadata

Release files for superwings-spinel 0.1.0

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

Source distribution (sdist)

Source distribution for superwings-spinel 0.1.0
File Size Uploaded
superwings_spinel-0.1.0.tar.gz 2.6 MB Details

Built distributions (wheels)

Table of built distributions (wheels) for superwings-spinel 0.1.0
File Interpreter ABI Platform
superwings_spinel-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl Python 3 none Linux glibc 2.17+ x86-64 Details
superwings_spinel-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl Python 3 none Linux glibc 2.17+ ARM64 Details
superwings_spinel-0.1.0-py3-none-macosx_11_0_universal2.whl Python 3 none macOS 11.0+ universal2 (ARM64, x86-64) Details

Total release size: 9.4 MB

Release files / superwings_spinel-0.1.0.tar.gz

Download URL superwings_spinel-0.1.0.tar.gz
Size 2.6 MB
Tags Source
SHA-256 checksum
How to use checksums
9a49353b1fe59586ae502a372faf02a094a3206086ee5d5e5236865ca8cbca08
BLAKE2b-256 checksum
How to use checksums
e0855e6b76276a68644b67551bb7eff6d548f9f6cffcde8ce980aaae018d6588
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / superwings_spinel-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL superwings_spinel-0.1.0-py3-none-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 1.7 MB
Tags Linux glibc 2.17+ x86-64 Python 3
SHA-256 checksum
How to use checksums
e0b3a381a53ffced1ffc9925b052a1c1da5323ed4f229872f2ab2b6116d1338c
BLAKE2b-256 checksum
How to use checksums
06eb6a86ee3e71c7491728f76f7e61d13d57519ec95de2db027dbf086f8c4e9b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / superwings_spinel-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL superwings_spinel-0.1.0-py3-none-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 1.7 MB
Tags Linux glibc 2.17+ ARM64 Python 3
SHA-256 checksum
How to use checksums
afc7b47f0f3f209d10a8d599f0a2666c6531e8e133a682f780238f26c418c25d
BLAKE2b-256 checksum
How to use checksums
ddfe17a04373192307f62e02839cb247884b52fd5b079f0fcf6edce12f53953b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release files / superwings_spinel-0.1.0-py3-none-macosx_11_0_universal2.whl

Download URL superwings_spinel-0.1.0-py3-none-macosx_11_0_universal2.whl
Size 3.4 MB
Tags Python 3 macOS 11.0+ universal2 (ARM64, x86-64)
SHA-256 checksum
How to use checksums
e2340e66ef88bc13a788c9f9285e37bc6338396e13b8196101c3975f2bbc508d
BLAKE2b-256 checksum
How to use checksums
5789419411a6cb5ee96f9334bccd498a47e1580dfb47b112b31647afdd4df6b5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Release history Release notifications | RSS feed

0.1.1

4 release files

This release

0.1.0 This release

4 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