Giter Club home page Giter Club logo

garminexport's Introduction

Garmin Connect activity backup tool

garminbackup.py is a program that downloads activities for a given Garmin Connect account and stores them in a backup directory locally on the user's computer. The first time the program is run, it will download all activities. After that, it will do incremental backups of your account. That is, the script will only download activities that haven't already been downloaded to the backup directory.

The library contains a simple utility program, get_activity.py for downloading a single Garmin Connect activity. Run ./get_activity.py --help for more details.

The library also contains a garminclient module that could be used by third-party projects that need to communicate over the Garmin Connect API. See the Library Import section below for more details.

Prerequisites

The instructions below for running the program (or importing the module) assumes that you have Python 2.7 or Python 3+, pip, and virtualenv (not required with Python 3) installed.

It also assumes that you have registered an account at Garmin Connect.

Getting started

Create and activate a new virtual environment to create an isolated development environment (that contains the required dependencies and nothing else).

# using Python 2
virtualenv venv.garminexport

# using Python 3
python -m venv venv.garminexport

Activate the virtual environment

. venv.garminexport/bin/activate

Install the required dependencies in this virtual environment:

pip install -r requirements.txt

Running

The backup program is run as follows (use the --help flag for a full list of available options):

./garminbackup.py --backup-dir=activities <username or email>

Once started, the program will prompt you for your account password and then log in to your Garmin Connect account to download activities to the specified backup directory on your machine. The program will only download activities that aren't already in the backup directory.

Activities can be exported in any of the formats outlined below. Note that by default, the program downloads all formats for every activity. Use the --format option to narrow the selection.

Supported export formats:

  • json_summary: activity summary file (JSON)

  • json_details: activity details file (JSON)

  • gpx: activity GPX file (XML)

  • tcx: an activity TCX file (XML). Note: a .tcx file may not always be possible to export, for example if an activity was uploaded in gpx format. In that case, Garmin won't try to synthesize a tcx file.

  • fit: activity FIT file (binary format). Note: a .fit file may not always be possible to export, for example if an activity was entered manually rather than imported from a Garmin device.

All files are written to the same directory (activities/ by default). Each activity file is prefixed by its upload timestamp and its activity id.

Library import

To install the development version of this library in your local Python environment, run:

pip install -e git://github.com/petergardfjall/garminexport.git#egg=garminexport

If you prefer to use a requirements.txt file, add the following line to your list of dependencies:

-e git://github.com/petergardfjall/garminexport.git#egg=garminexport

and run pip with you dependency file as input:

pip install -r requirements.txt

garminexport's People

Contributors

petergardfjall avatar dlenski avatar sdonk avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.