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)


Install it from PyPI:

pip install python-tcxparser


Basic usage example:

>>> import tcxparser
>>> tcx = tcxparser.TCXParser('/home/vinod/Downloads/20121226-212953.tcx')
>>> # Duration of workout in seconds
... tcx.duration
>>> # latitude/longitude at start of workout
... tcx.latitude
>>> tcx.longitude
>>> tcx.activity_type
>>> # ISO UTC timestamp when workout completed
... tcx.completed_at
>>> # distance of workout in meters
... tcx.distance
>>> tcx.distance_units
>>> # calories burned (as reported by device)
... tcx.calories


  • Python 2.7 or 3.6+


  • BSD


Please contact me with any questions: Vinod Kurup (

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.1.0.tar.gz (414.9 kB view hashes)

Uploaded source

Built Distribution

python_tcxparser-1.1.0-py3-none-any.whl (8.0 kB view hashes)

Uploaded py3

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Huawei Huawei PSF Sponsor Microsoft Microsoft PSF Sponsor NVIDIA NVIDIA PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page