Skip to main content

NautiPy

CI PyPI Python Typing License Docs

Easy coordinate handling, trustworthy WGS84 navigation, and diagnosed position fixes in one Python package.

Explore the educational guide and interactive Fix Lab for visual explanations and worked examples.

NautiPy accepts the coordinate formats people commonly paste or type, converts them into a validated Position, and provides navigation and position-fixing tools without silently guessing when an input is ambiguous.

Install

Use a Python version accepted by the requires-python setting, then install the complete package from PyPI:

python -m pip install nautipy

The installation includes GeographicLib, NumPy, and SciPy, so every feature is available immediately.

Quick start

Parse, inspect, and convert coordinates

from nautipy import convert_position, inspect_positions, parse_position

p1 = parse_position("50.12257, 8.66570")
p2 = parse_position("50° 7.3542' N; 8° 39.942' E")
p3 = parse_position("+50.12257+008.66570/")

assert p1 == p2 == p3
assert convert_position(
    "50.12257, 8.66570",
    to="dms",
) == "50° 7′ 21.25″ N; 8° 39′ 56.52″ E"

batch = inspect_positions(
    [
        "50.12257 N; 8.66570 E",
        "50, 8",
        "not a position",
    ],
    order="auto",
)
assert (
    batch.total_count,
    batch.parsed_count,
    batch.ambiguous_count,
    batch.invalid_count,
) == (3, 1, 1, 1)

Detection covers decimal degrees (DD), degrees and decimal minutes (DDM), degrees/minutes/seconds (DMS), two-dimensional ISO 6709, and NMEA coordinate field pairs. Use order="lonlat" for unmarked longitude-first input. order="auto" accepts hard axis evidence or equivalent source orders; otherwise it raises AmbiguousCoordinateError. Batch inspection preserves every yielded record's zero-based index and either its ParseResult or its structured coordinate failure.

Calculate WGS84 navigation values

from nautipy import destination, distance, inverse

start = "50.12257, 8.66570"
end = destination(start, bearing=90, distance=12_000)

assert abs(distance(start, end) - 12_000) < 1e-6

result = inverse(start, end)
print(result.initial_bearing)
print(result.final_bearing)

Distances are in metres and bearings are true degrees clockwise from north. Calculations use WGS84 ellipsoidal geodesics through GeographicLib.

Estimate a position from observations

from nautipy import Position, RangeObservation, solve_fix

references = (
    Position(50.116135, 8.670277),
    Position(50.112836, 8.666753),
    Position(50.110347, 8.659873),
)
ranges = tuple(
    RangeObservation(reference, measured, uncertainty=2.0)
    for reference, measured in zip(
        references,
        (1_275.251, 1_599.237, 1_917.145),
    )
)

result = solve_fix(ranges=ranges)
if result.success:
    print(result.position)
else:
    print(result.status, result.competing_positions)

Bearing, range, and mixed-observation fixes report residuals, convergence, and geometry diagnostics. A successful optimization does not by itself guarantee good observation geometry, so callers should inspect the complete result.

Use the command line

$ nautipy convert "50° 7.3542' N; 8° 39.942' E" --to dd
50.122570, 8.665700

$ nautipy inspect "+50.12257+008.66570/"

inspect writes deterministic JSON describing the detected format, normalizations, resolution, and candidate interpretations. python -m nautipy provides the same interface.

What is included

  • coordinate parsing, scalar and batch inspection, formatting, and conversion;
  • an immutable, validated Position model;
  • WGS84 distance, bearing, destination, interpolation, and nearest-position calculations;
  • diagnosed bearing, range, and mixed-observation fixes;
  • GeoJSON Point and FeatureCollection interchange; and
  • offline convert and inspect commands.

NautiPy is deliberately not a general GIS framework, charting application, route planner, live-data client, or certified navigation system.

Documentation

The NautiPy educational guide explains coordinate notation, ellipsoidal navigation, bearing and range fixes, uncertainty, and how the package fits those ideas together. It includes original diagrams and an interactive Fix Lab.

The exact behavior specifications remain in the repository:

For contributing and maintaining the project:

Please report ordinary bugs through the issue tracker. Report suspected security problems through the security policy. Participation is governed by the Code of Conduct.

NautiPy is available under the MIT License.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

nautipy-0.2.0.tar.gz (129.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

nautipy-0.2.0-py3-none-any.whl (52.2 kB view details)

Uploaded Python 3

File details

Details for the file nautipy-0.2.0.tar.gz.

File metadata

  • Download URL: nautipy-0.2.0.tar.gz
  • Upload date:
  • Size: 129.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for nautipy-0.2.0.tar.gz
Algorithm Hash digest
SHA256 032a3210af9131564d343b5007fe4a365f3a8b844c0904ecc1e1de6975d87518
MD5 1f46ca8f481de2365f116c7b5970199b
BLAKE2b-256 17beed2fed2584c88b7484c7f386eb857881fd9bb1a8becd14ed658e2e7c5521

See more details on using hashes here.

Provenance

The following attestation bundles were made for nautipy-0.2.0.tar.gz:

Publisher: release.yml on cafawo/NautiPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file nautipy-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: nautipy-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 52.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for nautipy-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9cafdecf1245aebc1995f8021b2ea04bb0a81d995ebe8a9031169f6a3ba3429e
MD5 fba6e0b14e56356627d6fc488bcee74e
BLAKE2b-256 f236a89b7a30bb7dd8e2cdb2cd004cce659a90eb8e67a56fd75ed5ef7e193f0f

See more details on using hashes here.

Provenance

The following attestation bundles were made for nautipy-0.2.0-py3-none-any.whl:

Publisher: release.yml on cafawo/NautiPy

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 files

0.1.0

2 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