Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

YATCX_parser

Yet Another TCX Parser
yatsx_parser in a more advanced parser of the Garmin data files that was influenced by python-tcxparser.
The main difference from the rest of the available parser is in the core idea of the project that is connected to the OpenLAPP framework (to be published) that requires interaction with a more low-lever data with more advanced data aggregations.
Current version extracts the following properties:

  • features dictionary of the available features in the .tcx file
  • has_powers flag that shows availability of the power measurements in the files
  • powers list of the extracted power measurements
  • grades list of the extracted slope grades in degrees
  • distances list of the passed distance
  • moves list of the moves during a single measurement
  • low_altitude_distance passed distance on a low-altitude (by default, 1500m)
  • high_altitude_distance passed distance on a high-altitudee (by default, 1500m)
  • elevations list of the elevations
  • total_elevation total elevation (or some of the positive climbs)
  • heart_rate list of the heart rate measurements
  • mean_heart_rate average heart rate during the session
  • speeds list of the speeds
  • altitudes list of the altitudes
  • cadences list of the cadences
  • high_altitude_time total time on the high-altitude(by default, 1500m)
  • total_distance total distance passed during the session
  • calories total calories
  • total_time total session time
  • datetime session start time
  • date session date
  • get_path(path, namespace) Read a value of a random value that could be found in the path inside of the namespace
  • read_xpath_property(xpath_obj, name)Read a numeric property name in the given xpath_obj object

Import statement

from yatcxparser import TcxParser

Default namespaces

Default namespaces from Garmin

Namespace -- URI --
ns http://www.garmin.com/xmlschemas/TrainingCenterDatabase/v2
ns2 http://www.garmin.com/xmlschemas/UserProfile/v2
ns3 http://www.garmin.com/xmlschemas/ActivityExtension/v2
ns4 http://www.garmin.com/xmlschemas/ProfileExtension/v1
ns5 http://www.garmin.com/xmlschemas/ActivityGoals/v1
xsi http://www.w3.org/2001/XMLSchema-instance

Init parameters

file_name mandatory parameter with a path to the .tcx file
pre_read flag that makes a pre-initiation of the data for a quicker access if the same properties are expected to be called many times. Default: False
params dictionary of parameters
recovery flag to perform data recovery with a linear interpolation. Alternatively set by the params. Default: True

Default parameters

By default, the parameters are set as following:

default_params = {  
    'high_altitude': 1500,  
    'recovery': True  
}

That corresopnds to a default min altitude of 1500 meters and replace all the missing values with a linear interplation model.

Usage

from yatcxparser import TcxParser
filename = '1.tcx'
tcxparser = TcxParser(filename, pre_read=True)
tcxparser.powers  
# get list of the powers [0,0 ... , 0, 0]  

Compatibility

| 3.6 | 3.7 | 3.8 | 3.9 |
| + | + | + | + |
'+' confirmed compatibility

License

MIT

Authors

Primary author: Aleksei Karetnikov

Metadata

Release files for yatcxparser 0.0.1b0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for yatcxparser 0.0.1b0
File Size Uploaded
yatcxparser-0.0.1b0.tar.gz 6.8 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for yatcxparser 0.0.1b0
File Interpreter ABI Platform
yatcxparser-0.0.1b0-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 17.0 kB

Release files / yatcxparser-0.0.1b0.tar.gz

Download URL yatcxparser-0.0.1b0.tar.gz
Size 6.8 kB
Tags Source
SHA-256 checksum
How to use checksums
ea1da94f39f3646531cf201956b34805eece8913eb1ae25803e48ddcdec0c1cf
BLAKE2b-256 checksum
How to use checksums
ec6bb18eece104a76445e8240b2060180befa01f2fe9e42dfc894e2c06340ce8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.7

Release files / yatcxparser-0.0.1b0-py2.py3-none-any.whl

Download URL yatcxparser-0.0.1b0-py2.py3-none-any.whl
Size 10.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ba4b6e9bcaeceab7eb0ada23196360f20c3e357b90d1daf68f41b936381c45bd
BLAKE2b-256 checksum
How to use checksums
1ac36d4895808a43e7fa991a6d50654b75d2f9028c1545f81cdaae57a3308212
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.4.1 importlib_metadata/3.10.0 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.8.7

Release history Release notifications | RSS feed

This release

0.0.1b0 This release

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page