pyGarminAPI package

Submodules

pyGarminAPI.garmin_api module

pyGarminAPI.garmin_api.convert_to_utc_seconds(date_time: str) int[source]

Convert the date time to UTC seconds

Parameters:

date_time (str) – Date time in the format of YYYY-MM-DD HH:MM:SS

Returns:

UTC seconds

Return type:

int

pyGarminAPI.garmin_api.generate_signature(email_pattern: str | None = None) List[Client][source]

Generate the signature for the API request

Parameters:

email_pattern (str, optional) – Email pattern to filter the database. Defaults to None.

Returns:

List of oauthlib.oauth1.Client objects to sign requests

Return type:

List[oauthlib.oauth1.Client]

pyGarminAPI.garmin_api.get_access_token(email_pattern: str | None = None) DataFrame[source]

Get the access token and secret from the database

Parameters:

email_pattern (str, optional) – Email pattern to filter the database. Defaults to None.

Returns:

DataFrame containing columns for the access token and secret

Return type:

pd.DataFrame

pyGarminAPI.garmin_api.get_daily_summary_activity(signature_client: Client, start_time: str, end_time: str) dict[source]

Retrieve daily summary activity data from the API

Parameters:
  • signature_client (oauthlib.oauth1.Client) – oauthlib.oauth1.Client object to sign requests

  • start_time (str) – Start time

  • end_time (str) – End time

Returns:

JSON response from the API

Return type:

dict

pyGarminAPI.garmin_api.get_daily_summary_health(signature_client: Client, start_time: str, end_time: str) dict[source]

Retrieve daily summary health data from the API

Parameters:
  • signature_client (oauthlib.oauth1.Client) – oauthlib.oauth1.Client object to sign requests

  • start_time (str) – Start time

  • end_time (str) – End time

Returns:

JSON response from the API

Return type:

dict

pyGarminAPI.garmin_api.get_permissions_scope(signature_client: Client) dict[source]

Retrieve permissions scope from the API

Parameters:

signature_client (oauthlib.oauth1.Client) – oauthlib.oauth1.Client object to sign requests

Returns:

JSON response from the API

Return type:

dict

pyGarminAPI.garmin_api.get_user_id(signature_client: Client) dict[source]

Retrieve user id from the API

Parameters:

signature_client (oauthlib.oauth1.Client) – oauthlib.oauth1.Client object to sign requests

Returns:

JSON response from the API

Return type:

dict

pyGarminAPI.garmin_api.load_config(config_file) dict[source]

Read the YAML config file

Parameters:

config_file (str) – YAML configuration file path

Module contents