Skip to main content

tcxreader is a parser/reader for Garmin’s TCX file format. It also works well with missing data!

Project description

Objective

This is a simple TCX parser / reader which can read Garmin TCX file extension files. The package currently does not support laps and merges the whole exercise into one exercise object. The following data is currently parsed: longitude, latitude, elevation, time, distance, hr_value, cadence, watts, TPX_speed (extension). The following statistics are calculated for each exercise: calories, hr_avg, hr_max, hr_min, avg_speed, start_time, end_time, duration, cadence_avg, cadence_max, ascent, descent, distance, altitude_max, altitude_min, altitude_avg

GitHub requests appreciated. pypi github

Installation

pip install tcxreader

Dependencies

This package uses maya for parsing / reading datetimes from TCX files.

Example

An example on how to use the package is shown below.

from tcxreader.tcxreader import TCXReader, TCXTrackPoint

tcx_reader = TCXReader()
file_location = 'example_data/15.tcx'

data: TCXTrackPoint = tcx_reader.read(file_location)
""" Example output:
data = {TCXExercise}
 activity_type = {str} 'Biking'
 ascent = {float} 1404.400026500225
 avg_speed = {float} 24.285282782608693
 cadence_avg = {NoneType} None
 cadence_max = {NoneType} None
 calories = {int} 2010
 descent = {float} 1422.000026166439
 distance = {float} 116366.98
 duration = {float} 17250.0
 end_time = {datetime} 2015-02-19 14:18:59+00:00
 hr_avg = {float} 140.59545804464972
 hr_max = {int} 200
 hr_min = {int} 94
 altitude_max = {float}
 altitude_min = {float}
 altitude_avg = {float}
 max_speed = {float} 18.95800018310547
 start_time = {datetime} 2015-02-19 09:31:29+00:00
 trackpoints = {list: 7799} [TCXTrackPoint]
 
    {TCXTrackPoint}
	 TPX_speed = {float} 5.011000156402588
	 cadence = {float} 80
	 distance = {float} 514.0499877929688
	 elevation = {float} 46.79999923706055
	 hr_value = {int} 134
	 latitude = {float} 45.5244944896549
	 longitude = {float} 13.596355207264423
	 time = {datetime} 2015-02-19 09:34:17+00:00
	 watts = {float} 123
"""

Features

Allows parsing / reading of TCX files.

Datasets

Datasets are available on the following links: DATASET1 , DATASET2

Licence

This package is distributed under the MIT License. This license can be found online at http://www.opensource.org/licenses/MIT.

Disclaimer

This framework is provided as-is, and there are no guarantees that it fits your purposes or that it is bug-free. Use it at your own risk!

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

tcxreader-0.3.9.tar.gz (642.6 kB view details)

Uploaded Source

Built Distribution

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

tcxreader-0.3.9-py3-none-any.whl (336.0 kB view details)

Uploaded Python 3

File details

Details for the file tcxreader-0.3.9.tar.gz.

File metadata

  • Download URL: tcxreader-0.3.9.tar.gz
  • Upload date:
  • Size: 642.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for tcxreader-0.3.9.tar.gz
Algorithm Hash digest
SHA256 fa24d6e22db0eb0d40545ef57c83eeef93ca9815f44665b9a6d7c86db600ff63
MD5 ac603a6c9bd482a321f61dd6c8ecf790
BLAKE2b-256 e266949829c608a9968da284fabd84ead0538cbe4de078c82eeaf93f90e4e676

See more details on using hashes here.

File details

Details for the file tcxreader-0.3.9-py3-none-any.whl.

File metadata

  • Download URL: tcxreader-0.3.9-py3-none-any.whl
  • Upload date:
  • Size: 336.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.10.2

File hashes

Hashes for tcxreader-0.3.9-py3-none-any.whl
Algorithm Hash digest
SHA256 29d7e49bb22064a54ba6bb68fe1ec90c906677fa7013b4059efbe081977ebff4
MD5 3afb5d1fe909ca329e5fef02961fdc5e
BLAKE2b-256 7a5eeea1cad90a5ff5ec1d19647ef0d96ad702e419c6d9e12de5409e92097108

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