Skip to main content

Simple parser for Garmin TCX files

Project description

Latest PyPI version Latest Travis CI build status Requirement Updates Code Coverage

python-tcxparser is a minimal parser for Garmin’s TCX file format. It is not in any way exhaustive. It extracts just enough data to allow me to post data from my Garmin ForeRunner 410 watch to DailyMile’s API.

Data extracted:
  • latitude & longitude of start point of workout

  • type of workout (running, walking, etc)

  • time of completion of workout (in ISO UTC)

  • distance of workout (in meters)

  • duration of workout (in seconds)

  • calories burned during workout (as estimated by device)

  • average, max and min heart rate during workout

  • average pace during workout

  • average altitude during workout

  • ascent and descent of workout

  • max and min altitude

  • time stamp of each data point (in ISO UTC)

  • average and max cadence (cycling activities)

Installation

Install it from PyPI:

pip install python-tcxparser

Usage

Basic usage example:

>>> import tcxparser
>>> tcx = tcxparser.TCXParser('/home/vinod/Downloads/20121226-212953.tcx')
>>> # Duration of workout in seconds
... tcx.duration
1992.78
>>> # latitude/longitude at start of workout
... tcx.latitude
35.951880198
>>> tcx.longitude
-79.0931872185
>>> tcx.activity_type
'running'
>>> # ISO UTC timestamp when workout completed
... tcx.completed_at
'2012-12-26T22:03:05Z'
>>> # distance of workout in meters
... tcx.distance
4686.31103516
>>> tcx.distance_units
'meters'
>>> # calories burned (as reported by device)
... tcx.calories
379

Compatibility

  • Python 2.7 or 3.7+

License

  • BSD

Contact

Please contact me with any questions: Vinod Kurup (vinod@kurup.com)

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

python-tcxparser-1.0.0.tar.gz (3.6 kB view details)

Uploaded Source

Built Distribution

python_tcxparser-1.0.0-py3-none-any.whl (5.0 kB view details)

Uploaded Python 3

File details

Details for the file python-tcxparser-1.0.0.tar.gz.

File metadata

  • Download URL: python-tcxparser-1.0.0.tar.gz
  • Upload date:
  • Size: 3.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for python-tcxparser-1.0.0.tar.gz
Algorithm Hash digest
SHA256 223862521b1f8e3d5a7a16c1afa25749d0595ef1edcd28dab0c67ede4b53e381
MD5 e2f29552f9a21086cfa2a5ad7988b2ec
BLAKE2b-256 cd6295374cbd22794cb29ce22ce67b82e6f10414e99c8f6f54cc19ef4f398ba8

See more details on using hashes here.

File details

Details for the file python_tcxparser-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: python_tcxparser-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 5.0 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.21.0 setuptools/40.6.3 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.0

File hashes

Hashes for python_tcxparser-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 7189ee8a1237de1a0de0b21a3689a1db01afaeba5b76741dfaa5da33b4d33f8b
MD5 84110b13b7d04d4d1ce17766f3bb54b3
BLAKE2b-256 e6e814f9abfa4e645ee0bb7e54e595e8d993bcc804f844c159c3e6a62c79b182

See more details on using hashes here.

Supported by

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