|
3 | 3 | A command-line tool for working with Strava activities. |
4 | 4 |
|
5 | 5 | * Bulk upload activities, including manual activities, from a `.csv` file. |
6 | | -* Bulk edit existing your activities by downloading a `.csv` file and editing |
7 | | - it in an editor or spreadsheet application, then uploading the changes. |
| 6 | +* Bulk edit existing activities by downloading a `.csv` file and editing it in |
| 7 | + an editor or spreadsheet application, then uploading the changes. |
8 | 8 |
|
9 | 9 | ## Instructions |
10 | 10 |
|
@@ -57,105 +57,96 @@ with other `stravacli` commands. |
57 | 57 |
|
58 | 58 | You may have to repeat this step periodically if your access token expires. |
59 | 59 |
|
| 60 | +### CSV Files |
| 61 | + |
| 62 | +Most `stravacli` use [CSV](https://en.wikipedia.org/wiki/Comma-separated_values) |
| 63 | +data. There are lots of ways to edit CSV data, including: |
| 64 | + |
| 65 | +* Using an editor like `vi` or `emacs`. |
| 66 | +* In a spreadsheet application like `Google Sheets` or `Microsoft Excel`. |
| 67 | + |
| 68 | +Use Google to find out more. If you're using `Google Sheets` (it's free!), |
| 69 | +[here](https://support.google.com/docs/answer/40608) is help on how to import a |
| 70 | +`.csv` into Google Sheets. To export back to `.csv`, choose `File -> Download -> |
| 71 | +Comma-separated values`. |
| 72 | + |
60 | 73 | ### Update Existing Activities |
61 | 74 |
|
62 | 75 | To bulk update existing Strava activities, first download them: |
63 | 76 |
|
64 | 77 | ```bash |
65 | | -stravacli download --access_token <YOUR_ACCESS_TOKEN> --out orig.csv |
| 78 | +stravacli download --access_token=<YOUR_ACCESS_TOKEN> --out=orig.csv |
66 | 79 | ``` |
67 | 80 |
|
68 | | -This will download your existing activities into a file called `orig.csv`, in |
69 | | -`csv` format. See `stravacli download help` for more detailed help on available |
70 | | -flags, and what the columns mean. You can now open or import the `csv` file in a |
71 | | -spreadsheet application of your choice; see the bottom of the page for tips. |
| 81 | +This will download your existing activities into a [CSV file](#csv-files) file |
| 82 | +called `orig.csv`. See `stravacli download help` for more detailed help, and |
| 83 | +what the columns mean. You can now open or import the `csv` file in a |
| 84 | +spreadsheet application of your choice. |
72 | 85 |
|
73 | 86 | Edit away; all of the columns are editable except for `ID` and `Start`. Sadly, |
74 | 87 | there are a lot of fields for activities that are not editable via the Strava |
75 | 88 | API. |
76 | 89 |
|
77 | | -When you are done editing, export the data as a `.csv` file again; again, see |
78 | | -the bottom of the page for tips. Make sure not to clobber the original `.csv`; |
79 | | -the instructions below assume you name the file `updated.csv`. |
| 90 | +When you are done editing, export the data as a `.csv` file again. Make sure not |
| 91 | +to clobber the original `.csv`; the instructions below assume you name the file |
| 92 | +`updated.csv`. |
80 | 93 |
|
81 | 94 | Finally, use `stravacli` to apply the changes. You can use `--dryrun` to see |
82 | 95 | what changes would be made without actually making them. |
83 | 96 |
|
84 | 97 | ```bash |
85 | | -stravacli update --access_token <YOUR_ACCESS_TOKEN> --orig=orig.csv --updated updated.csv |
| 98 | +stravacli update --access_token=<YOUR_ACCESS_TOKEN> --orig=orig.csv --updated=updated.csv |
86 | 99 | ``` |
87 | 100 |
|
88 | | -See `stravacli update help` for more detailed help on available flags. |
| 101 | +See `stravacli update help` for more detailed help. |
89 | 102 |
|
90 | 103 | ### Upload Activities |
91 | 104 |
|
92 | 105 | See the next section for Manual Activities; this section is for activities with |
93 | | -an associated `.gpx` or similar file. To bulk upload activities, first get the |
94 | | -required header: |
| 106 | +an associated `.gpx`, `tcx`, or `.fit` file. To bulk upload activities, first |
| 107 | +get the required header: |
95 | 108 |
|
96 | 109 | ```bash |
97 | | -stravacli uploadheader |
| 110 | +stravacli uploadheader > activities.csv |
98 | 111 | ``` |
99 | 112 |
|
100 | 113 | See `stravacli uploadheader help` for detailed descriptions of the data columns. |
101 | 114 |
|
102 | | -Copy/paste the header data into a spreadsheet application of your choice; see |
103 | | -the bottom of the page for tips. Add rows for the activities you'd like to |
104 | | -create. |
105 | | - |
106 | | -When you're done, export the data as a `.csv` file; again, see the bottom of the |
107 | | -page for tips. The instructions below assume you name the file `activities.md`. |
| 115 | +Add rows to the [CSV file](#csv-files) for the activities you'd like to create. |
108 | 116 |
|
109 | 117 | Finally, use `stravacli` to upload. You can use `--dryrun` to see what changes |
110 | 118 | would be made without actually making them. |
111 | 119 |
|
112 | 120 | ```bash |
113 | | -stravacli upload --access_token <YOUR_ACCESS_TOKEN> --in=activities.csv |
| 121 | +stravacli upload --access_token=<YOUR_ACCESS_TOKEN> --in=activities.csv |
114 | 122 | ``` |
115 | 123 |
|
116 | | -See `stravacli upload help` for more detailed help on available flags. |
| 124 | +See `stravacli upload help` for more detailed help. |
117 | 125 |
|
118 | 126 | ### Upload Manual Activities |
119 | 127 |
|
120 | 128 | To bulk upload manual activities, first get the required header: |
121 | 129 |
|
122 | 130 | ```bash |
123 | | -stravacli uploadmanualheader |
| 131 | +stravacli uploadmanualheader > activities.csv |
124 | 132 | ``` |
125 | 133 |
|
126 | 134 | See `stravacli uploadmanualheader help` for detailed descriptions of the data |
127 | 135 | columns. |
128 | 136 |
|
129 | | -Copy/paste the header data into a spreadsheet application of your choice; see |
130 | | -the bottom of the page for tips. Add rows for the activities you'd like to |
131 | | -create. Note that `Duration` is in seconds, and `Distance` is in meters! |
132 | | - |
133 | | -When you're done, export the data as a `.csv` file; again, see the bottom of the |
134 | | -page for tips. The instructions below assume you name the file `activities.md`. |
| 137 | +Add rows to the [CSV file](#csv-files) for the activities you'd like to create. |
| 138 | +Note that `Duration` is in seconds, and `Distance` is in meters! |
135 | 139 |
|
136 | 140 | Finally, use `stravacli` to upload. You can use `--dryrun` to see what changes |
137 | 141 | would be made without actually making them. |
138 | 142 |
|
139 | 143 | ```bash |
140 | | -stravacli uploadmanual --access_token <YOUR_ACCESS_TOKEN> --in=activities.csv |
| 144 | +stravacli uploadmanual --access_token=<YOUR_ACCESS_TOKEN> --in=activities.csv |
141 | 145 | ``` |
142 | 146 |
|
143 | | -See `stravacli uploadmanual help` for more detailed help on available flags. |
| 147 | +See `stravacli uploadmanual help` for more detailed help. |
144 | 148 |
|
145 | 149 | ### Cleanup |
146 | 150 |
|
147 | 151 | If you are done using `stravacli`, you can revoke its API access |
148 | 152 | [here](https://www.strava.com/settings/apps). |
149 | | - |
150 | | -### Editing CSV Files |
151 | | - |
152 | | -There are lots of ways to edit |
153 | | -[CSV](https://en.wikipedia.org/wiki/Comma-separated_values) data, including: |
154 | | - |
155 | | -* Using an editor like `vi` or `emacs`. |
156 | | -* In a spreadsheet application like `Google Sheets` or `Microsoft Excel`. |
157 | | - |
158 | | -Since `Google Sheets` is free... |
159 | | -[Here](https://support.google.com/docs/answer/40608) is help on how to import a |
160 | | -`.csv` into Google Sheets. To export back to `.csv`, choose `File -> Download -> |
161 | | -Comma-separated values`. |
0 commit comments