ColCarroll / strava_calendar

Visualizations from Strava data in matplotlib
MIT License
84 stars 7 forks source link

get_files for gpx #4

Closed kratsg closed 3 years ago

kratsg commented 3 years ago

The following should work at least for grabbing the gpx as well

def get_files(zip_path):
    pattern = re.compile(r"^activities/\d+.gpx$")
    with zipfile.ZipFile(zip_path) as run_zip:
        good_files = [f for f in run_zip.namelist() if pattern.match(f)]
        for filename in tqdm.tqdm(good_files):
            yield run_zip.open(filename).read()
ColCarroll commented 3 years ago

Thanks! I'll look around and see if I have a gpx file lying around to test this on :D

ColCarroll commented 3 years ago

Think this is now fixed.