kjkjava / garmin-connect-export

Download a copy of your Garmin Connect data, including stats and GPX tracks.
MIT License
314 stars 134 forks source link

Python 3 ready (non-ascii ok!) #15

Closed ebrensi closed 8 years ago

ebrensi commented 8 years ago

Activities containing text with characters like ö, ä, ü are written correctly to activity files and the summary csv. This script is fully Python 2/3 compatible and PEP8 compliant.

This update of gcexport.py uses requests module, and logging module instead of print statements. Otherwise, some general workflow clean-up. Aside from being Python 3 compatible and handling non-ascii characters, this script functions identically.

I also included fixes for issues https://github.com/kjkjava/garmin-connect-export/issues/10 and https://github.com/kjkjava/garmin-connect-export/issues/11.

travsgweber commented 8 years ago

Hi! Have you confirmed that these versions are Python 3 compatible? I just spent the day getting the original code set to run in Python 3. The print statements were one thing, but the variance between string and binary variables was another. This set of code here looks a bit cleaner, so maybe I'll go through and make my Python 3 changes here?

ebrensi commented 8 years ago

Yes, I just now ran it with python 3.5 on my (Linux Mint) laptop. I went through a bit of trial and error to get string encoding right. Mine has the added benefit that it can handle non-ascii characters in the activity name and description, which is an issue for European users.

btw I ended up adapting your script to populate a PostgreSQL database here: https://github.com/ebrensi/running_data/blob/master/gcexport-db.py which I'm using for a little activity tracker app.

travsgweber commented 8 years ago

Thanks, I’m not the original author though. I’m just modifying it as well to my own purposes. That’s cool what you did though, I also want to export it and import it into an Amazon Web Services mysql server. Your PostgreSQL code looks like it may work with a bit of modification.

t.

From: Efrem Rensi [mailto:notifications@github.com] Sent: Thursday, June 16, 2016 2:11 PM To: kjkjava/garmin-connect-export garmin-connect-export@noreply.github.com Cc: travsgweber travisgweber@gmx.com; Comment comment@noreply.github.com Subject: Re: [kjkjava/garmin-connect-export] Python 3 ready (non-ascii ok!) (#15)

Yes, I just now ran it with python 3.5 on my (Linux Mint) laptop. I went through a bit of trial and error to get string encoding right. Mine has the added benefit that it can handle non-ascii characters in the activity name and description, which is an issue for European users.

btw I ended up adapting your script to populate a PostgreSQL database here: https://github.com/ebrensi/running_data/blob/master/gcexport-db.py which I'm using for a little activity tracker app.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kjkjava/garmin-connect-export/pull/15#issuecomment-226599293 , or mute the thread https://github.com/notifications/unsubscribe/ATDltAaeAsAg9g_OP0R3yM2763va1mi-ks5qMa2_gaJpZM4IYjVz . https://github.com/notifications/beacon/ATDltIguC3mqS0kF-bflY9abPIjHntFSks5qMa2_gaJpZM4IYjVz.gif

travsgweber commented 8 years ago

Sorry guys, just noticed I was cc’d on the thread (not direct recipient).

My bad ;-)

Trav.

From: Efrem Rensi [mailto:notifications@github.com] Sent: Thursday, June 16, 2016 2:11 PM To: kjkjava/garmin-connect-export garmin-connect-export@noreply.github.com Cc: travsgweber travisgweber@gmx.com; Comment comment@noreply.github.com Subject: Re: [kjkjava/garmin-connect-export] Python 3 ready (non-ascii ok!) (#15)

Yes, I just now ran it with python 3.5 on my (Linux Mint) laptop. I went through a bit of trial and error to get string encoding right. Mine has the added benefit that it can handle non-ascii characters in the activity name and description, which is an issue for European users.

btw I ended up adapting your script to populate a PostgreSQL database here: https://github.com/ebrensi/running_data/blob/master/gcexport-db.py which I'm using for a little activity tracker app.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kjkjava/garmin-connect-export/pull/15#issuecomment-226599293 , or mute the thread https://github.com/notifications/unsubscribe/ATDltAaeAsAg9g_OP0R3yM2763va1mi-ks5qMa2_gaJpZM4IYjVz . https://github.com/notifications/beacon/ATDltIguC3mqS0kF-bflY9abPIjHntFSks5qMa2_gaJpZM4IYjVz.gif

travsgweber commented 8 years ago

Your heatmap is pretty cool.

Trav.

From: Efrem Rensi [mailto:notifications@github.com] Sent: Thursday, June 16, 2016 2:11 PM To: kjkjava/garmin-connect-export garmin-connect-export@noreply.github.com Cc: travsgweber travisgweber@gmx.com; Comment comment@noreply.github.com Subject: Re: [kjkjava/garmin-connect-export] Python 3 ready (non-ascii ok!) (#15)

Yes, I just now ran it with python 3.5 on my (Linux Mint) laptop. I went through a bit of trial and error to get string encoding right. Mine has the added benefit that it can handle non-ascii characters in the activity name and description, which is an issue for European users.

btw I ended up adapting your script to populate a PostgreSQL database here: https://github.com/ebrensi/running_data/blob/master/gcexport-db.py which I'm using for a little activity tracker app.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/kjkjava/garmin-connect-export/pull/15#issuecomment-226599293 , or mute the thread https://github.com/notifications/unsubscribe/ATDltAaeAsAg9g_OP0R3yM2763va1mi-ks5qMa2_gaJpZM4IYjVz . https://github.com/notifications/beacon/ATDltIguC3mqS0kF-bflY9abPIjHntFSks5qMa2_gaJpZM4IYjVz.gif

ebrensi commented 8 years ago

Well this pull request is no longer relevant.