Git Product home page Git Product logo

strava-cli's Introduction

  • ๐Ÿ‘‹ Hi, Iโ€™m @bwilczynski
  • ๐Ÿ‘€ My current focus is on Software Delivery, High-traffic Distributed Systems, Kubernetes and Public Cloud
  • ๐ŸŒฑ Iโ€™m currently enjoying writing code in Go

strava-cli's People

Contributors

bwilczynski avatar dependabot[bot] avatar docsmooth avatar futureshape avatar mattf avatar rhydlewis avatar strawp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar

strava-cli's Issues

Create an app

Wouldn't it be a good idea to create an application at Strava that are used by everyone?
Simplifies setup.

Speed formatting not appropriate for all activities

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.

login issues

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.

strava activity throws me this error

# 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

MissingTokenError: (missing_token) Missing access token parameter.

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.

Unexpected keyword argument 'package_name'

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'

Feature request: Have list of activities in JSON format

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.

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.