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:
featuresdictionary of the available features in the .tcx filehas_powersflag that shows availability of the power measurements in the filespowerslist of the extracted power measurementsgradeslist of the extracted slope grades in degreesdistanceslist of the passed distancemoveslist of the moves during a single measurementlow_altitude_distancepassed distance on a low-altitude (by default, 1500m)high_altitude_distancepassed distance on a high-altitudee (by default, 1500m)elevationslist of the elevationstotal_elevationtotal elevation (or some of the positive climbs)heart_ratelist of the heart rate measurementsmean_heart_rateaverage heart rate during the sessionspeedslist of the speedsaltitudeslist of the altitudescadenceslist of the cadenceshigh_altitude_timetotal time on the high-altitude(by default, 1500m)total_distancetotal distance passed during the sessioncaloriestotal caloriestotal_timetotal session timedatetimesession start timedatesession dateget_path(path, namespace)Read a value of a random value that could be found in thepathinside of thenamespaceread_xpath_property(xpath_obj, name)Read a numeric property name in the given xpath_obj object
Default namespaces from Garmin
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
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.
filename = '1.tcx'
tcxparser = TcxParser(filename, pre_read=True)
tcxparser.powers
# get list of the powers [0,0 ... , 0, 0]
| 3.6 | 3.7 | 3.8 | 3.9 |
|---|---|---|---|
| + | + | + | + |
'+' confirmed compatibility
MIT
Primary author: Aleksei Karetnikov