Skip to main content

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)

Metadata

Release files for tp-lib 0.0.6

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

Source distribution (sdist)

Source distribution for tp-lib 0.0.6
File Size Uploaded
tp_lib-0.0.6.tar.gz 236.7 kB Details

Built distributions (wheels)

Table of built distributions (wheels) for tp-lib 0.0.6
File Interpreter ABI Platform
tp_lib-0.0.6-cp312-cp312-win_amd64.whl CPython 3.12 CPython 3.12 Windows x86-64 Details
tp_lib-0.0.6-cp312-cp312-manylinux_2_35_x86_64.whl CPython 3.12 CPython 3.12 Linux glibc 2.35+ x86-64 Details
tp_lib-0.0.6-cp312-cp312-macosx_11_0_arm64.whl CPython 3.12 CPython 3.12 macOS 11.0+ ARM64 Details

Total release size: 19.6 MB

Release files / tp_lib-0.0.6.tar.gz

Download URL tp_lib-0.0.6.tar.gz
Size 236.7 kB
Tags Source
SHA-256 checksum
How to use checksums
7e11830551b5ac77cc64c64c8b3a8f298dc559d68f3be0e14cbb24851c3a7e38
BLAKE2b-256 checksum
How to use checksums
7f68297ae3541d4415665d97c1473edbb6c3f85f46d4a4a72d4af42330fea1ac
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 25, 2026.

Transparency log

Release files / tp_lib-0.0.6-cp312-cp312-win_amd64.whl

Download URL tp_lib-0.0.6-cp312-cp312-win_amd64.whl
Size 6.2 MB
Tags CPython 3.12 Windows x86-64
SHA-256 checksum
How to use checksums
c740d02b34508d53ee848d75870be6b7932a35b534467deb9fdf457c24acc466
BLAKE2b-256 checksum
How to use checksums
508229d3172c24e4942875f68d5f61286afd41df01c1c178e4e8c3f43752d250
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 25, 2026.

Transparency log

Release files / tp_lib-0.0.6-cp312-cp312-manylinux_2_35_x86_64.whl

Download URL tp_lib-0.0.6-cp312-cp312-manylinux_2_35_x86_64.whl
Size 7.0 MB
Tags CPython 3.12 Linux glibc 2.35+ x86-64
SHA-256 checksum
How to use checksums
09b968c276e31ffb55cb8d48e29c39b78375f072fa2820a4e711861f5d0d2964
BLAKE2b-256 checksum
How to use checksums
2cffd06431f49cfbc7813d48abbcb43963edb0d772cb40404b01c33bdfba1d9c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 25, 2026.

Transparency log

Release files / tp_lib-0.0.6-cp312-cp312-macosx_11_0_arm64.whl

Download URL tp_lib-0.0.6-cp312-cp312-macosx_11_0_arm64.whl
Size 6.2 MB
Tags CPython 3.12 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
367a6f799fd74e508167f7a255faf700db157ea42f9016a740ee71c7c37c98b4
BLAKE2b-256 checksum
How to use checksums
f1896cccdc2efd752ad9877aa81d20fa40bd20331326cb1ac10a7ed333f91f57
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.12

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on May 25, 2026.

Transparency log

Release history Release notifications | RSS feed

This release

0.0.6 This release

4 release files

0.0.5

4 release files

0.0.1

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