def remove_trkpt_namespaces(trkpt: ET.ElementTree, namespaces: Dict[str, str]) -> None: ''' By default the each trkpt and their sub-elements would have an "ns0:" prefix on them. We don't want that, so we set the tag manually. ''' trkpt.tag = 'trkpt' ele = trkpt.find('gpx:ele', namespaces) ele.tag = 'ele' time = trkpt.find('gpx:time', namespaces) time.tag = 'time'