komPYoot.api
Created on Tue Aug 2 12:51:22 2022.
@author: Nishad Mandlik
- class API[source]
Bases:
objectClass for interfacing with the Komoot API.
- download_tour_gpx(tour_id, download_dir)[source]
Download tour in the GPX format.
- Parameters
tour_id (str) – Tour ID.
download_dir (str) – Path of the directory where the downloaded tour will be saved.
- Raises
RuntimeError – If no user is logged-in.
- Returns
file_name if download is successful, None otherwise.
- Return type
str or None
- get_user_disp_name()[source]
Return the display name of the logged-in user.
- Raises
RuntimeError – If no user is logged-in.
- Returns
- Return type
str.
- get_user_email()[source]
Return the email ID of the logged-in user.
- Raises
RuntimeError – If no user is logged-in.
- Returns
- Return type
str.
- get_user_id()[source]
Return the user ID of the logged-in user.
- Raises
RuntimeError – If no user is logged-in.
- Returns
- Return type
str.
- get_user_pic_url()[source]
Return the display picture URL of the logged-in user. If picture is not set, None is returned.
- Raises
RuntimeError – If no user is logged-in.
- Returns
- Return type
str or None.
- get_user_tours_list(tour_type=None, tour_status=None, sport=None)[source]
Get the list of tours for the logged-in user, according to the user-defined filters.
- Parameters
tour_type (TOUR_TYPE or None, optional) – Bitwise OR-ed flags for filtering multiple tour types. The default is None.
tour_status (TOUR_STATUS or None, optional) – Bitwise OR-ed flags for filtering multiple tour statuses. The default is None.
sport (SPORT or None, optional) – Bitwise OR-ed flags for filtering multiple sports. The default is None.
- Raises
RuntimeError – If no user is logged-in.
- Returns
tours – List of dictionaries containing details of tours.
- Return type
list
- class SPORT(value)[source]
Bases:
AutoFlagFlag Enum for Sports.
Obtained from https://static.komoot.de/doc/external-api/v007/sports.html