Skip to main content

Simple parser for Garmin TCX files

Project description

Latest PyPI version Latest Travis CI build status Updates

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

  • ascent and descent of workout

  • max and min altitude

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

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.5+

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-0.8.0.tar.gz (3.5 kB view details)

Uploaded Source

Built Distribution

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

python_tcxparser-0.8.0-py2.py3-none-any.whl (3.6 kB view details)

Uploaded Python 2Python 3

File details

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

File metadata

File hashes

Hashes for python-tcxparser-0.8.0.tar.gz
Algorithm Hash digest
SHA256 f3959e58cea1d302d1d4090dd6c69b1e0987ef413a9aae8aedd9926567fab4e7
MD5 569f3e36c4e738026921722fe02a0a28
BLAKE2b-256 dc18332c0880a88d38a0aa701b2579aa7f17687e45142d2d9d4997820d6362a9

See more details on using hashes here.

File details

Details for the file python_tcxparser-0.8.0-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for python_tcxparser-0.8.0-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 905c3b5d25e3b7a20a84d23724aad198d441142f3c96d49bef952e264ce546f0
MD5 adccf4ff00e9d8707d19414e820fb6e7
BLAKE2b-256 7a59c48cf12fa8cc937d795eaf6680681c625dfb279a7ad902a96a3a45f62bdd

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