Convert Garmin TPX to GPX
This module converts the Garmin tcx GPS file format to the more commonly used gpx file format. Both formats are a form of XML but there are some fields in the former that are not present in the later. It uses two packages to do the grunt work tcxparser and gpxpy.
git clone cd pip install .
Single file conversion
For convenience the
convert() method runs all steps...
from tcx2gpx import TCX2GPX gps_object = tcx2gpx.TCX2GPX(tcx_path='file_to_convert.tcx') gps_object.convert()
If you want to run the steps manually...
gps_object.read_tcx gps_object.extract_track_points() gps_object.create_gpx() gps_object.write_gpx()
If you wish to access individual features then these are simply the
@properties or methods of
tcxparser, for example...
Often you will have many files you wish to convert, a convenience wrapper is provided. You specify the
--directory that contains the files and they will be converted. It runs jobs in parallel and the number
of jobs to be run concurrently can be specified with the
python ./batch_convert.py --directory ~/my_tcx_workouts/ -j 6
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.