Skip to main content

Train Positioning Library - GNSS track axis projection

Project description

tp-lib Python Bindings

Python bindings for the Train Positioning Library (TP-Lib), providing GNSS track axis projection and train path calculation.

Installation

pip install tp-lib

Usage

Timestamps

Input timestamps may be RFC3339 with an explicit offset (e.g. 2025-12-09T14:30:00+01:00 or 2025-12-09T14:30:00Z) or naive ISO 8601 (e.g. 2025-12-09T14:30:00, 2025-12-09 14:30:00). Naive values are interpreted in the host's local timezone. All timestamps returned by the library are RFC3339 strings carrying an explicit timezone offset.

from tp_lib import project_gnss, ProjectionConfig

config = ProjectionConfig(max_search_radius_meters=1000.0)
result = project_gnss(gnss_positions, network, config)

Automatic RINF Topology Retrieval

If you omit network (or pass None), the library downloads a bounding-box subset of the ERA RINF topology on demand:

from tp_lib import project_gnss, RinfRetrievalOptions

result = project_gnss(
    gnss_positions=gnss_positions,
    network=None,
    rinf_options=RinfRetrievalOptions(
        endpoint_url="https://graph.data.era.europa.eu/repositories/rinf-plus",
        buffer_meters=1000.0,
    ),
)

Errors are raised as built-in exceptions (ValueError, RuntimeError) when retrieval cannot satisfy the request. The same overload exists for calculate_train_path.

The library may raise:

  • ValueError for invalid input (e.g., malformed GNSS data or invalid coordinates)
  • RuntimeError for operational failures (e.g., RINF topology retrieval errors)

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

tp_lib-0.0.6.tar.gz (236.7 kB view details)

Uploaded Source

Built Distributions

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

tp_lib-0.0.6-cp312-cp312-win_amd64.whl (6.2 MB view details)

Uploaded CPython 3.12Windows x86-64

tp_lib-0.0.6-cp312-cp312-manylinux_2_35_x86_64.whl (7.0 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.35+ x86-64

tp_lib-0.0.6-cp312-cp312-macosx_11_0_arm64.whl (6.2 MB view details)

Uploaded CPython 3.12macOS 11.0+ ARM64

File details

Details for the file tp_lib-0.0.6.tar.gz.

File metadata

  • Download URL: tp_lib-0.0.6.tar.gz
  • Upload date:
  • Size: 236.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tp_lib-0.0.6.tar.gz
Algorithm Hash digest
SHA256 7e11830551b5ac77cc64c64c8b3a8f298dc559d68f3be0e14cbb24851c3a7e38
MD5 d1b77968355417cd56aec9c63e5daf60
BLAKE2b-256 7f68297ae3541d4415665d97c1473edbb6c3f85f46d4a4a72d4af42330fea1ac

See more details on using hashes here.

Provenance

The following attestation bundles were made for tp_lib-0.0.6.tar.gz:

Publisher: publish-pypi.yml on Matdata-eu/tp-lib

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

File details

Details for the file tp_lib-0.0.6-cp312-cp312-win_amd64.whl.

File metadata

  • Download URL: tp_lib-0.0.6-cp312-cp312-win_amd64.whl
  • Upload date:
  • Size: 6.2 MB
  • Tags: CPython 3.12, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for tp_lib-0.0.6-cp312-cp312-win_amd64.whl
Algorithm Hash digest
SHA256 c740d02b34508d53ee848d75870be6b7932a35b534467deb9fdf457c24acc466
MD5 07bfdaf63bcbfddc132cf4fb8ff02013
BLAKE2b-256 508229d3172c24e4942875f68d5f61286afd41df01c1c178e4e8c3f43752d250

See more details on using hashes here.

Provenance

The following attestation bundles were made for tp_lib-0.0.6-cp312-cp312-win_amd64.whl:

Publisher: publish-pypi.yml on Matdata-eu/tp-lib

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

File details

Details for the file tp_lib-0.0.6-cp312-cp312-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for tp_lib-0.0.6-cp312-cp312-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 09b968c276e31ffb55cb8d48e29c39b78375f072fa2820a4e711861f5d0d2964
MD5 276b023f451614b20466e35eaff1a140
BLAKE2b-256 2cffd06431f49cfbc7813d48abbcb43963edb0d772cb40404b01c33bdfba1d9c

See more details on using hashes here.

Provenance

The following attestation bundles were made for tp_lib-0.0.6-cp312-cp312-manylinux_2_35_x86_64.whl:

Publisher: publish-pypi.yml on Matdata-eu/tp-lib

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

File details

Details for the file tp_lib-0.0.6-cp312-cp312-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for tp_lib-0.0.6-cp312-cp312-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 367a6f799fd74e508167f7a255faf700db157ea42f9016a740ee71c7c37c98b4
MD5 ffc59f5e606f919c6df27a5530f837e2
BLAKE2b-256 f1896cccdc2efd752ad9877aa81d20fa40bd20331326cb1ac10a7ed333f91f57

See more details on using hashes here.

Provenance

The following attestation bundles were made for tp_lib-0.0.6-cp312-cp312-macosx_11_0_arm64.whl:

Publisher: publish-pypi.yml on Matdata-eu/tp-lib

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

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page