Skip to main content

Simple parser for Garmin/Polar 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.6+

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

dpac-tcxparser-1.0.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

dpac_tcxparser-1.0.1-py3-none-any.whl (5.5 kB view details)

Uploaded Python 3

File details

Details for the file dpac-tcxparser-1.0.1.tar.gz.

File metadata

  • Download URL: dpac-tcxparser-1.0.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/3.6.5

File hashes

Hashes for dpac-tcxparser-1.0.1.tar.gz
Algorithm Hash digest
SHA256 6afcb4ad0d40633d65a0cf6149352f15a32186dd9af25ace017477e3ff5cff10
MD5 88dd45a599708e4ba1ace5faed60cca5
BLAKE2b-256 feebb2822cec95332e4e2195c6f64342ece491914add68f74ace51b74cd5f132

See more details on using hashes here.

File details

Details for the file dpac_tcxparser-1.0.1-py3-none-any.whl.

File metadata

  • Download URL: dpac_tcxparser-1.0.1-py3-none-any.whl
  • Upload date:
  • Size: 5.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.11.0 pkginfo/1.4.2 requests/2.18.4 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.19.8 CPython/3.6.5

File hashes

Hashes for dpac_tcxparser-1.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 a722f8fdd1034af7ae66474829d9acdbd9b7faba6f96ce8a9631f00db2493080
MD5 9acd11f18d3e74231872b1d660edea4a
BLAKE2b-256 91c69c75c2adb7d8fd37caede2acd30c7f7ae253a2b5ac78cbd01d3824bb23c6

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