8000 GitHub - sladkovm/strava-swagger-client: Strava Swagger API Client, used as a dependency in stravaio
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

sladkovm/strava-swagger-client

Repository files navigation

swagger-client

Strava API

This Python package is automatically generated by the Swagger Codegen project:

  • API version: 3.0.0
  • Package version: 1.0.0
  • Build package: io.swagger.codegen.languages.PythonClientCodegen

Requirements.

Python 2.7 and 3.4+

Installation & Usage

pip install

If the python package is hosted on Github, you can install directly from Github

pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git)

Then import the package:

import swagger_client 

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import swagger_client

Getting Started

Please follow the installation procedure and then run the following:

from __future__ import print_function
import time
import swagger_client
from swagger_client.rest import ApiException
from pprint import pprint

# Configure OAuth2 access token for authorization: strava_oauth
configuration = swagger_client.Configuration()
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# create an instance of the API class
api_instance = swagger_client.ActivitiesApi(swagger_client.ApiClient(configuration))
name = 'name_example' # str | The name of the activity.
type = 'type_example' # str | Type of activity. For example - Run, Ride etc.
start_date_local = swagger_client.ERRORUNKNOWN() # ERRORUNKNOWN | ISO 8601 formatted date time.
elapsed_time = 56 # int | In seconds.
description = 'description_example' # str | Description of the activity. (optional)
distance = 3.4 # float | In meters. (optional)
trainer = 56 # int | Set to 1 to mark as a trainer activity. (optional)
photo_ids = swagger_client.ERRORUNKNOWN() # ERRORUNKNOWN | List of native photo ids to attach to the activity. (optional)
commute = 56 # int | Set to 1 to mark as commute. (optional)

try:
    # Create an Activity
    api_response = api_instance.create_activity(name, type, start_date_local, elapsed_time, description=description, distance=distance, trainer=trainer, photo_ids=photo_ids, commute=commute)
    pprint(api_response)
except ApiException as e:
    print("Exception when calling ActivitiesApi->create_activity: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://www.strava.com/api/v3

Class Method HTTP request Description
ActivitiesApi create_activity POST /activities Create an Activity
ActivitiesApi get_activity_by_id GET /activities/{id} Get Activity
ActivitiesApi get_comments_by_activity_id GET /activities/{id}/comments List Activity Comments
ActivitiesApi get_kudoers_by_activity_id GET /activities/{id}/kudos List Activity Kudoers
ActivitiesApi get_laps_by_activity_id GET /activities/{id}/laps List Activity Laps
ActivitiesApi get_logged_in_athlete_activities GET /athlete/activities List Athlete Activities
ActivitiesApi get_zones_by_activity_id GET /activities/{id}/zones Get Activity Zones
ActivitiesApi update_activity_by_id PUT /activities/{id} Update Activity
AthletesApi get_logged_in_athlete GET /athlete Get Authenticated Athlete
AthletesA 8000 pi get_logged_in_athlete_zones GET /athlete/zones Get Zones
AthletesApi get_stats GET /athletes/{id}/stats Get Athlete Stats
AthletesApi update_logged_in_athlete PUT /athlete Update Athlete
ClubsApi get_club_activities_by_id GET /clubs/{id}/activities List Club Activities
ClubsApi get_club_admins_by_id GET /clubs/{id}/admins List Club Administrators.
ClubsApi get_club_by_id GET /clubs/{id} Get Club
ClubsApi get_club_members_by_id GET /clubs/{id}/members List Club Members
ClubsApi get_logged_in_athlete_clubs GET /athlete/clubs List Athlete Clubs
GearsApi get_gear_by_id GET /gear/{id} Get Equipment
RoutesApi get_route_as_gpx GET /routes/{id}/export_gpx Export Route GPX
RoutesApi get_route_as_tcx GET /routes/{id}/export_tcx Export Route TCX
RoutesApi get_route_by_id GET /routes/{id} Get Route
RoutesApi get_routes_by_athlete_id GET /athletes/{id}/routes List Athlete Routes
RunningRacesApi get_running_race_by_id GET /running_races/{id} Get Running Race
RunningRacesApi get_running_races GET /running_races List Running Races
SegmentEffortsApi get_efforts_by_segment_id GET /segments/{id}/all_efforts List Segment Efforts
SegmentEffortsApi get_segment_effort_by_id GET /segment_efforts/{id} Get Segment Effort
SegmentsApi explore_segments GET /segments/explore Explore segments
SegmentsApi get_leaderboard_by_segment_id GET /segments/{id}/leaderboard Get Segment Leaderboard
SegmentsApi get_logged_in_athlete_starred_segments GET /segments/starred List Starred Segments
SegmentsApi get_segment_by_id GET /segments/{id} Get Segment
SegmentsApi star_segment PUT /segments/{id}/starred Star Segment
StreamsApi get_activity_streams GET /activities/{id}/streams Get Activity Streams
StreamsApi get_segment_effort_streams GET /segment_efforts/{id}/streams Get segment effort streams
StreamsApi get_segment_streams GET /segments/{id}/streams Get Segment Streams
UploadsApi create_upload POST /uploads Upload Activity
UploadsApi get_upload_by_id GET /uploads/{uploadId} Get Upload

Documentation For Models

Documentation For Authorization

strava_oauth

  • Type: OAuth
  • Flow: accessCode
  • Authorization URL: https://www.strava.com/api/v3/oauth/authorize
  • Scopes:
  • read: Read public segments, public routes, public profile data, public posts, public events, club feeds, and leaderboards
  • read_all: Read private routes, private segments, and private events for the user
  • profile:read_all: Read all profile information even if the user has set their profile visibility to Followers or Only You
  • profile:write: Update the user's weight and Functional Threshold Power (FTP), and access to star or unstar segments on their behalf
  • activity:read: Read the user's activity data for activities that are visible to Everyone and Followers, excluding privacy zone data
  • activity:read_all: The same access as activity:read, plus privacy zone data and access to read the user's activities with visibility set to Only You
  • activity:write: Access to create manual activities and uploads, and access to edit any activities that are visible to the app, based on activity read access level

Author

About

Strava Swagger API Client, used as a dependency in stravaio

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published
0