is there a way to change activity category in a large batch?

I just moved a LOT of gpx files to garmin connect (most pre-carmin connect) and the they are of course, un-uncategorized. I was wondering if there was a way to change a LOT of file categories at a time rather than one at a time?

  • Hi! I've tried to run the script and I get into cryptic errors from some of the libraries that are being used (i.e. urllib and the ssl-wrapper, it seems). Also, do you have the link to the original github repository? The github-users mentioned in the script don't seem to have it online on their profile anymore... Thanks!

  • This is brilliant! Would it be possible to put up a version of this script up to change everything to the below? - 

    activity_type_fitness_equipment=Gym & Fitness Equipment

    - thanks in advance!

  • Hi, Just new here. I can see how your script works. Do you know how to add the following

    1. Change which gear was associated with the ride

    2. Change the ride title to remove the "Uncategorised" from the description.

  • I've posted a new version of the script (now called gc-activity-type.py): forums.garmin.com/.../899953

    New features:
    1) Filter by existing activity type, activity type ID or activity parent type ID(use the --help option to see available options)

    2) Select new activity type, activity type ID and activity parent type ID using command line options (otherwise you will be prompted)

    3) Preview changes using --dry-run option. Matched activities are listed during a dry run, along with their activity type (e.g. "running"),  activity type ID (e.g. 1), and activity parent type ID (e.g. 18)  So if you want to find out the type name, type id and parent ID for inline skating, you can create a new inline skating activity manually, and use the "--dry-run" option to list the information that you'll need to change other activities to inline skating.

    4) Fix SSL error that some users were experiencing

  • This is brilliant! Would it be possible to put up a version of this script up to change everything to the below? - 

    activity_type_fitness_equipment=Gym & Fitness Equipment

    Sorry for the late reply, but if you use the new version of the script (forums.garmin.com/.../899953), you can:
    1) Create a new manual activity with the new type you are interested in, to find out the type name, type ID and parent type ID

    2) Use the information from 1. with the new script

    I created a Gym and Fitness Equipment activity and the info you need is:

    Type Name: fitness_equipment

    Type ID: 29

    Parent Type ID: 17

  • Thanks for your tool. I had to figure out that the py file has to be run from command line window if I want to use options. Furthermore the activity type of walking is 9, parent 17. Mentioned only if it helps someone.

  • used it around month ago and it worked good.
    Today I wanted to use it again for some imported activities and it ends with some errors

    copy of it

    Logging in...

    Searching for activities (this might take a while)...

    Traceback (most recent call last):
    File "gcchange04.py", line 324, in <module> ACTIVITY_LIST = http_req(ACLISTURL)
    File "gcchange04.py", line 115, in http_req response = OPENER.open((request), data=post)
    File "C:\Program Files\Python38\lib\urllib\request.py", line 531, in open response = meth(req, response)
    File "C:\Program Files\Python38\lib\urllib\request.py", line 640, in http_response response = self.parent.error(
    File "C:\Program Files\Python38\lib\urllib\request.py", line 569, in error return self._call_chain(*args)
    File "C:\Program Files\Python38\lib\urllib\request.py", line 502, in _call_chain result = func(*args)
    File "C:\Program Files\Python38\lib\urllib\request.py", line 649, in http_error_default raise HTTPError(req.full_url, code, msg, hdrs, fp)
    urllib.error.HTTPError: HTTP Error 402: Payment Required
    Press ENTER to exit.

    Did Garmin change something? or it is problem with my system? not sure if something changed in my PC

  • Hey, thanks for the bug report! Garmin made a small change which broke the script. I updated it -- see link in this comment: forums.garmin.com/.../899953

  • Hi,

    Can you confirm the defaults for running please?

    Activity Type = Running

    AT ID = 1

    APT = 18

    Couldn't find them in --help

    Cheers,

    Sean