Skip to content

Separate files for each activity #6

@lukashino

Description

@lukashino

I think other sport application require activities to be divided in separate files. It would be nice to have there although as Endomondo is at the end I am not really expecting to be it implemented. It can possibly serve others.
data.gpx is the file exported from your application
data[1-n].gpx are files of individual activities

import json

with open('data.gpx') as json_file:
    data = json.load(json_file)
    i = 0
    for o in data:
        i+=1
        with open(f'data{i}.gpx', 'w', encoding='utf-8') as f:
            json.dump(o, f, ensure_ascii=False, indent=4)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions