Skip to main content

Open Parquet-native format for high-frequency telematics data (GNSS+IMU). Read, validate, and convert datasets.

Project description

telemachus-py

Python SDK for the Telemachus open telematics format — read, validate, convert, and introspect high-frequency GNSS+IMU datasets.

pip install -e .

Read a dataset

import telemachus as tele

df = tele.read("path/to/manifest.yaml")   # → pandas DataFrame
print(tele.sensor_profile(df))             # → "gps+imu+gyro"

Sensor introspection

tele.has_gps(df)       # True if lat, lon, speed_mps non-NaN
tele.has_imu(df)       # True if ax, ay, az non-NaN
tele.has_gyro(df)      # True if gx, gy, gz present
tele.has_magneto(df)   # True if mx, my, mz present
tele.has_obd(df)       # True if speed_obd or rpm present
tele.has_io(df)        # True if ignition or voltage present
tele.is_full_imu(df)   # accel + gyro
tele.is_gps_only(df)   # GPS but no IMU

Validate

report = tele.validate(df, profile="imu")
print(report)
# ValidationReport(PASS, profile=imu, level=basic, errors=0, warnings=0)

report = tele.validate_dataset("path/to/dataset/", level="full")

Three profiles adapt validation to hardware capabilities:

Profile Required columns Use case
core ts, lat, lon, speed_mps GPS trackers, fleet APIs
imu core + ax, ay, az Telematics devices with accelerometer
full imu + gx, gy, gz Research platforms with gyroscope

Convert Open datasets

tele convert aegis /path/to/aegis/csvs -o datasets/aegis/
tele convert pvs /path/to/pvs/trips -o datasets/pvs/ --placement dashboard
tele convert stride /path/to/stride/road_data -o datasets/stride/ --category driving

Supported Open datasets:

Adapter Source Sensors License
aegis Zenodo 820576 (Austria) GPS 5Hz + Accel 24Hz + Gyro + OBD CC-BY-4.0
pvs Kaggle (Brazil) GPS 1Hz + Accel 100Hz + Gyro + Magneto CC-BY-NC-ND-4.0
stride Figshare (Bangladesh) GPS 1Hz + Accel 100Hz + Gyro + Magneto CC-BY-4.0

CLI

tele validate path/to/manifest.yaml          # validate manifest
tele validate path/to/dataset/ --level full   # validate dataset
tele info path/to/manifest.yaml               # dataset summary
tele convert aegis /data/aegis -o out/        # convert Open dataset

Telemachus record format

A Telemachus record is a flat Parquet row with 7 functional groups:

# Group Columns Status
1 Datetime ts Mandatory
2 GNSS lat, lon, speed_mps, heading_deg, altitude_gps_m, hdop, h_accuracy_m, n_satellites Mandatory (lat/lon/speed)
3 IMU ax_mps2, ay_mps2, az_mps2, gx_rad_s, gy_rad_s, gz_rad_s, mx_uT, my_uT, mz_uT Profile-dependent
4 OBD speed_obd_mps, rpm, odometer_m Optional
5 CAN x_can_<signal> Future
6 I/O ignition, vehicle_voltage_v Optional
7 Extra x_<source>_<field> Optional

Full specification: SPEC-01 | SPEC-02 | SPEC-03

Development

pip install -e .[dev]
pytest                  # 31 tests

License

AGPL-3.0

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

telemachus-0.8.0.tar.gz (51.2 kB view details)

Uploaded Source

Built Distribution

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

telemachus-0.8.0-py3-none-any.whl (53.9 kB view details)

Uploaded Python 3

File details

Details for the file telemachus-0.8.0.tar.gz.

File metadata

  • Download URL: telemachus-0.8.0.tar.gz
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for telemachus-0.8.0.tar.gz
Algorithm Hash digest
SHA256 c0a78762a2e5979e33f8320cb54d34744e362feb20f785dfcaed838ed568b63c
MD5 da7a00285bffcd0b4a3c02b142f72e21
BLAKE2b-256 9440b7078b3c2976ea8e064c9082559a42573ccac20718fecc279fc328dfa74d

See more details on using hashes here.

File details

Details for the file telemachus-0.8.0-py3-none-any.whl.

File metadata

  • Download URL: telemachus-0.8.0-py3-none-any.whl
  • Upload date:
  • Size: 53.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.12.2

File hashes

Hashes for telemachus-0.8.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e68b94f220a4a578e8a29ecc53dbf35074d502e7d7080ceaadb76a6c37a01eb7
MD5 97434c532530c7f8d1eff77c593371cc
BLAKE2b-256 850c466d80e5deacee87c1bf872453ba6fb7f163630287697551b518f85c5ced

See more details on using hashes here.

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