bwilczynski / strava-cli Goto Github PK
View Code? Open in Web Editor NEWStrava command-line interface
License: MIT License
Strava command-line interface
License: MIT License
This kind of command:
strava activities --after="2018-12-01"
no matter how you configure it, the output only has 30 activities.
Is it a feature or a bug?
I installed from pip and pulling the latest from main, and both versions just give me this error:
$ strava config
Traceback (most recent call last):
File "/home/chris/.local/bin/strava", line 5, in <module>
from strava.cli import cli
File "/home/chris/.local/lib/python3.9/site-packages/strava/cli.py", line 17, in <module>
def cli():
File "/usr/lib/python3/dist-packages/click/decorators.py", line 304, in decorator
return option(*(param_decls or ("--version",)), **attrs)(f)
File "/usr/lib/python3/dist-packages/click/decorators.py", line 192, in decorator
_param_memo(f, OptionClass(param_decls, **option_attrs))
File "/usr/lib/python3/dist-packages/click/core.py", line 1714, in __init__
Parameter.__init__(self, param_decls, type=type, **attrs)
TypeError: __init__() got an unexpected keyword argument 'package_name'
When I try to login, it takes me to the right page but after I click 'authorize', I return to the terminal where I get the following error. Any ideas?
Traceback (most recent call last):
File "/usr/local/bin/strava", line 11, in <module>
load_entry_point('strava-cli==0.4.9', 'console_scripts', 'strava')()
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 764, in __call__
return self.main(*args, **kwargs)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 717, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 1137, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 956, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 555, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/strava/decorators.py", line 86, in wrapper_config_required
return func(*args, **kwargs)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/strava/commands/login.py", line 20, in login
data = auth_flow.get_access_token(code)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/strava/api/oauth2.py", line 64, in get_access_token
client_secret=self.client_secret)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 307, in fetch_token
self._client.parse_request_body_response(r.text, scope=self.scope)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 415, in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 425, in parse_token_response
validate_token_parameters(params)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 435, in validate_token_parameters
raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.
Hello,
Great program! Thanks!
I was wondering if it would be possible to have the list of activities in JSON format. I capture track information from a number of sources, but keep the "canonical" title in Strava. I have programs that get all of these together and rename my other activities to match. It would be great to have the list of activities in a machine parsable format.
Ran config
&& login
.
After hitting Authorize
on the Strava web form - which displayed my app - I received this traceback:
# 12:30 % strava login
Traceback (most recent call last):
File "/usr/local/bin/strava", line 11, in <module>
load_entry_point('strava-cli==0.4.9', 'console_scripts', 'strava')()
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 829, in __call__
return self.main(*args, **kwargs)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 782, in main
rv = self.invoke(ctx)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 1259, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 1066, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/click/core.py", line 610, in invoke
return callback(*args, **kwargs)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/strava/decorators.py", line 86, in wrapper_config_required
return func(*args, **kwargs)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/strava/commands/login.py", line 20, in login
data = auth_flow.get_access_token(code)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/strava/api/oauth2.py", line 64, in get_access_token
client_secret=self.client_secret)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/requests_oauthlib/oauth2_session.py", line 360, in fetch_token
self._client.parse_request_body_response(r.text, scope=self.scope)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/clients/base.py", line 421, in parse_request_body_response
self.token = parse_token_response(body, scope=scope)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 431, in parse_token_response
validate_token_parameters(params)
File "/usr/local/Cellar/strava-cli/0.4.9/libexec/lib/python3.7/site-packages/oauthlib/oauth2/rfc6749/parameters.py", line 441, in validate_token_parameters
raise MissingTokenError(description="Missing access token parameter.")
oauthlib.oauth2.rfc6749.errors.MissingTokenError: (missing_token) Missing access token parameter.
# strava activity 9505348135
Traceback (most recent call last):
File "/home/luca/.local/bin/strava", line 8, in <module>
sys.exit(cli())
File "/usr/lib/python3/dist-packages/click/core.py", line 1128, in __call__
return self.main(*args, **kwargs)
File "/usr/lib/python3/dist-packages/click/core.py", line 1053, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1659, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
File "/usr/lib/python3/dist-packages/click/core.py", line 1395, in invoke
return ctx.invoke(self.callback, **ctx.params)
File "/usr/lib/python3/dist-packages/click/core.py", line 754, in invoke
return __callback(*args, **kwargs)
File "/home/luca/.local/lib/python3.10/site-packages/strava/decorators.py", line 103, in wrapper_login_required
return func(*args, **kwargs)
File "/home/luca/.local/lib/python3.10/site-packages/strava/commands/activity.py", line 43, in get_activity
_format_activity(result, output=output)
File "/home/luca/.local/lib/python3.10/site-packages/strava/decorators.py", line 62, in wrapper_format_result
res = func(*args, **kwargs)
File "/home/luca/.local/lib/python3.10/site-packages/strava/commands/activity.py", line 52, in _format_activity
return result if output == OutputType.JSON.value else _as_table(result)
File "/home/luca/.local/lib/python3.10/site-packages/strava/commands/activity.py", line 123, in _as_table
for k, v in apply_formatters(activity, formatters).items()
File "/home/luca/.local/lib/python3.10/site-packages/strava/formatters.py", line 102, in apply_formatters
return {
File "/home/luca/.local/lib/python3.10/site-packages/strava/formatters.py", line 103, in <dictcomp>
k: formatter(activity[k], activity) if k in activity else N_A
TypeError: _as_table.<locals>.format_gear() takes 1 positional argument but 2 were given
Wouldn't it be a good idea to create an application at Strava that are used by everyone?
Simplifies setup.
Speed is formated as minutes per km or minutes per mile which is common for running activities, but for cycling (and some other activities like skiiing) users probably expect the speed to be shown as kilometers per hour or miles per hour.
Hi, love this project!
As the tables use tabulate can the enumerable at https://github.com/bwilczynski/strava-cli/blob/master/strava/decorators.py#L20 be extended to support "github" and have this able to be specified through a command line switch?
Thanks!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.