Skip to main content

Simple parser for Garmin TCX files

Project description

# python-tcxparser

[ ![Codeship Status for vkurup/python-tcxparser](https://codeship.com/projects/73da6380-712d-0132-3214-62f5102d8589/status?branch=master)](https://codeship.com/projects/54578)

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](http://dailymile.com) 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

## Installation

pip install python-tcxparser

## Usage

>>> 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

## 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-0.7.0.tar.gz (4.0 kB view details)

Uploaded Source

File details

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

File metadata

File hashes

Hashes for python-tcxparser-0.7.0.tar.gz
Algorithm Hash digest
SHA256 3360cfaad723522882093dd102d384cb87da4bc24338a1e1f92cea9aab13f829
MD5 ced7b5183580f92d09c59ed3b0528f89
BLAKE2b-256 8d46d0d4ad167d7cb5a1e6e68dcf773b6d142383f372551fa19c9ac0837ed195

See more details on using hashes here.

Supported by

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