### Install Terra Python Library Source: https://github.com/tryterra/terra-client-python/blob/master/README.md This snippet demonstrates how to install the Terra Python library using pip, the standard package installer for Python. It ensures all necessary dependencies are downloaded and configured for use in your project. ```sh pip install terra-python ``` -------------------------------- ### Fetch Detailed Terra Integrations with Filtering Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Provides an example of fetching a detailed list of supported integrations, with an option to filter by SDK usage. Requires `dev_id` and `api_key` for client initialization. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.integrations.detailedfetch() ``` ```APIDOC client.integrations.detailedfetch(sdk: typing.Optional[bool], request_options: typing.Optional[RequestOptions]) Description: Retrieve a detailed list of supported integrations, optionally filtered by the developer's enabled integrations and the requirement for SDK usage. sdk: If `true`, allows SDK integrations to be included in the response. request_options: Request-specific configuration. ``` -------------------------------- ### Instantiate and Use Terra Synchronous Client Source: https://github.com/tryterra/terra-client-python/blob/master/README.md This example shows how to initialize the synchronous Terra client with your developer ID and API key. It then demonstrates a basic API call to fetch integrations using the client instance, illustrating a typical synchronous workflow. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.integrations.fetch() ``` -------------------------------- ### Fetch Daily Activity Data with Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Provides a Python usage example and API documentation for fetching daily summaries of activity metrics like steps, distance, and calories burned for a given user ID. ```Python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.daily.fetch( user_id="user_id", start_date=1, ) ``` ```APIDOC client.daily.fetch(...) Description: Fetches daily summaries of activity metrics such as steps, distance, calories burned etc. for a given user ID Parameters: user_id: str — user ID to query data for start_date: DailyFetchRequestStartDate — start date of data to query for - either ISO8601 date or unix timestamp end_date: typing.Optional[int] — end date of data to query for - either ISO8601 date or unix timestamp to_webhook: typing.Optional[bool] — boolean flag specifying whether to send the data retrieved to the webhook, or in the response with_samples: typing.Optional[bool] — boolean flag specifying whether to include detailed samples in the returned payload request_options: typing.Optional[RequestOptions] — Request-specific configuration. ``` -------------------------------- ### Fetch Nutrition Log Data with Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Provides a Python usage example and API documentation for fetching nutrition log data, including meal type, calories, and macronutrients, for a given user ID. ```Python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.nutrition.fetch( user_id="user_id", start_date=1, ) ``` ```APIDOC client.nutrition.fetch(...) Description: Fetches nutrition log data such as meal type, calories, macronutrients etc. for a given user ID Parameters: user_id: str — user ID to query data for start_date: NutritionFetchRequestStartDate — start date of data to query for - either ISO8601 date or unix timestamp end_date: typing.Optional[int] — end date of data to query for - either ISO8601 date or unix timestamp to_webhook: typing.Optional[bool] — boolean flag specifying whether to send the data retrieved to the webhook, or in the response with_samples: typing.Optional[bool] — boolean flag specifying whether to include detailed samples in the returned payload request_options: typing.Optional[RequestOptions] — Request-specific configuration. ``` -------------------------------- ### Customize Httpx Client for Terra Python Source: https://github.com/tryterra/terra-client-python/blob/master/README.md This example demonstrates how to override the default `httpx` client used by the Terra SDK. This allows for advanced customizations such as configuring proxies, custom transports, or other `httpx` client settings for specific network requirements. ```python import httpx from terra import Terra client = Terra( ..., httpx_client=httpx.Client( proxies="http://my.test.proxy.example.com", transport=httpx.HTTPTransport(local_address="0.0.0.0"), ), ) ``` -------------------------------- ### Fetch Menstruation Data with Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Provides a Python usage example and API documentation for fetching menstruation data such as cycle length, period length, and ovulation date for a given user ID. ```Python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.menstruation.fetch( user_id="user_id", start_date=1, ) ``` ```APIDOC client.menstruation.fetch(...) Description: Fetches menstruation data such as cycle length, period length, ovulation date etc. for a given user ID Parameters: user_id: str — user ID to query data for start_date: MenstruationFetchRequestStartDate — start date of data to query for - either ISO8601 date or unix timestamp end_date: typing.Optional[int] — end date of data to query for - either ISO8601 date or unix timestamp to_webhook: typing.Optional[bool] — boolean flag specifying whether to send the data retrieved to the webhook, or in the response with_samples: typing.Optional[bool] — boolean flag specifying whether to include detailed samples in the returned payload request_options: typing.Optional[RequestOptions] — Request-specific configuration. ``` -------------------------------- ### Write Nutrition Data using Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Demonstrates how to write nutrition data, including metadata like start and end times, to a data provider using the Terra Python client. This method allows posting new nutrition entries. ```python from terra import Nutrition, NutritionMetadata, Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.nutrition.write( data=[ Nutrition( metadata=NutritionMetadata( end_time="2022-10-28T10:00:00.000000+01:00", start_time="1999-11-23T09:00:00.000000+02:00", ), ) ], ) ``` ```APIDOC client.nutrition.write( data: typing.Sequence[Nutrition] - Nutrition entry to post to data provider request_options: typing.Optional[RequestOptions] - Request-specific configuration. ) ``` -------------------------------- ### Get Information for Multiple Terra User IDs Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This method is designed to query for information pertaining to a list of multiple specified Terra User IDs. It allows efficient retrieval of data for several users in a single request. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.user.getinfoformultipleuserids( request=["string"], ) ``` ```APIDOC client.user.getinfoformultipleuserids(...) request: typing.Sequence[str] request_options: typing.Optional[RequestOptions] — Request-specific configuration. ``` -------------------------------- ### Configure API Request Retries in Terra Python Source: https://github.com/tryterra/terra-client-python/blob/master/README.md This example demonstrates how to configure the maximum number of retries for an API request using the `max_retries` option within `request_options`. This allows customization of the SDK's automatic retry behavior for transient network or server errors. ```python client.integrations.fetch(..., request_options={ "max_retries": 1 }) ``` -------------------------------- ### Fetch Completed Activity Sessions from Terra Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This method retrieves completed workout sessions, allowing filtering by a defined start and end time, and specific activity types such as running or cycling. It provides options to send data to a webhook or include detailed samples. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.activity.fetch( user_id="user_id", start_date=1, ) ``` ```APIDOC client.activity.fetch(...) user_id: str — user ID to query data for start_date: ActivityFetchRequestStartDate — start date of data to query for - either ISO8601 date or unix timestamp end_date: typing.Optional[int] — end date of data to query for - either ISO8601 date or unix timestamp to_webhook: typing.Optional[bool] — boolean flag specifying whether to send the data retrieved to the webhook, or in the response with_samples: typing.Optional[bool] — boolean flag specifying whether to include detailed samples in the returned payload request_options: typing.Optional[RequestOptions] — Request-specific configuration. ``` -------------------------------- ### Handle API Errors with Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/README.md This example demonstrates how to catch and handle `ApiError` exceptions thrown by the Terra client when the API returns a non-success status code (4xx or 5xx). It shows how to access the status code and response body of the error for debugging and robust error handling. ```python from terra.core.api_error import ApiError try: client.integrations.fetch(...) except ApiError as e: print(e.status_code) print(e.body) ``` -------------------------------- ### Get Terra User Information by ID or Reference ID Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This method allows querying for information about a single Terra user using their user ID, or retrieving all registered Terra User objects associated with a specific reference ID. It supports flexible querying based on either identifier. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.user.getinfoforuserid() ``` ```APIDOC client.user.getinfoforuserid(...) user_id: typing.Optional[str] — user ID to query for reference_id: typing.Optional[str] — reference ID to query for request_options: typing.Optional[RequestOptions] — Request-specific configuration. ``` -------------------------------- ### Fetch All Available Terra Integrations Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Shows how to retrieve a list of all available provider integrations supported by the Terra API. Authentication with `dev_id` and `api_key` is required. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.integrations.fetch() ``` ```APIDOC client.integrations.fetch(request_options: typing.Optional[RequestOptions]) Description: Retrieve a list of all available provider integrations on the API. request_options: Request-specific configuration. ``` -------------------------------- ### Write Planned Workout Data using Terra Python SDK Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Demonstrates how to initialize the Terra client and write planned workout data to the provider. Requires `dev_id` and `api_key` for authentication. ```python from terra import PlannedWorkout, Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.plannedworkout.write( data=[PlannedWorkout()], ) ``` ```APIDOC client.plannedworkout.write(data: typing.Sequence[PlannedWorkout], request_options: typing.Optional[RequestOptions]) data: PlannedWorkout entry to post to data provider request_options: Request-specific configuration. ``` -------------------------------- ### Write Body Metrics Data using Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Demonstrates how to initialize the Terra client and post body data to a provider (e.g., Google Fit) using the `client.body.write` method, including `Body` and `BodyMetadata` objects. ```python from terra import Body, BodyMetadata, Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.body.write( data=[ Body( metadata=BodyMetadata( end_time="2022-10-28T10:00:00.000000+01:00", start_time="1999-11-23T09:00:00.000000+02:00", ), ) ], ) ``` -------------------------------- ### Fetch Body Metrics Data using Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Shows how to initialize the Terra client and fetch body metrics like weight, height, and body fat percentage for a specified user ID and date range using `client.body.fetch`. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.body.fetch( user_id="user_id", start_date=1, ) ``` -------------------------------- ### Write Activity Data using Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Demonstrates how to initialize the Terra client and write activity data using the `client.activity.write` method. This involves creating `Activity` and `ActivityMetadata` objects with relevant timestamps and IDs. ```python from terra import Activity, ActivityMetadata, Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.activity.write( data=[ Activity( metadata=ActivityMetadata( end_time="2022-10-28T10:00:00.000000+01:00", start_time="1999-11-23T09:00:00.000000+02:00", summary_id="123e4567-e89b-12d3-a456-426614174000", type=1.1, upload_type=1.1, ), ) ], ) ``` -------------------------------- ### Instantiate and Use Terra Asynchronous Client Source: https://github.com/tryterra/terra-client-python/blob/master/README.md This snippet illustrates how to use the `AsyncTerra` client for non-blocking API calls, which is ideal for high-performance applications. It demonstrates initializing the async client and making an asynchronous API request within an `asyncio` event loop. ```python import asyncio from terra import AsyncTerra client = AsyncTerra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) async def main() -> None: await client.integrations.fetch() asyncio.run(main()) ``` -------------------------------- ### Fetch Athlete Profile Data using Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Illustrates how to initialize the Terra client and fetch athlete profile information for a given user ID using the `client.athlete.fetch` method. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.athlete.fetch( user_id="user_id", ) ``` -------------------------------- ### API Reference: client.activity.write Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md API documentation for the `client.activity.write` method, used to post activity data to a provider. ```APIDOC client.activity.write(...) Description: Used to post activity data to a provider. Parameters: data: typing.Sequence[Activity] - List of user-tracked workouts to post to data provider request_options: typing.Optional[RequestOptions] - Request-specific configuration. ``` -------------------------------- ### API Reference: client.body.write Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md API documentation for the `client.body.write` method, used to post body data to a provider. Currently available for Google Fit. ```APIDOC client.body.write(...) Description: Used to post body data to a provider. Available for Google Fit Parameters: data: typing.Sequence[Body] - Body measurement metrics to post to data provider request_options: typing.Optional[RequestOptions] - Request-specific configuration. ``` -------------------------------- ### API Reference: client.body.fetch Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md API documentation for the `client.body.fetch` method, used to retrieve body metrics such as weight, height, body fat percentage etc. for a given user ID. ```APIDOC client.body.fetch(...) Description: Fetches body metrics such as weight, height, body fat percentage etc. for a given user ID Parameters: user_id: str - user ID to query data for start_date: BodyFetchRequestStartDate - start date of data to query for - either ISO8601 date or unix timestamp end_date: typing.Optional[int] - end date of data to query for - either ISO8601 date or unix timestamp to_webhook: typing.Optional[bool] - boolean flag specifying whether to send the data retrieved to the webhook, or in the response with_samples: typing.Optional[bool] - boolean flag specifying whether to include detailed samples in the returned payload request_options: typing.Optional[RequestOptions] - Request-specific configuration. ``` -------------------------------- ### Fetch Planned Workout Data using Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Demonstrates how to retrieve planned workout data, such as strength or cardio workouts, for a given user ID and date range using the Terra Python client. This includes details like sets, reps, and intervals. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.plannedworkout.fetch( user_id="user_id", start_date=1, ) ``` ```APIDOC client.plannedworkout.fetch( user_id: str - user ID to query data for start_date: PlannedWorkoutFetchRequestStartDate - start date of data to query for - either ISO8601 date or unix timestamp end_date: typing.Optional[int] - end date of data to query for - either ISO8601 date or unix timestamp to_webhook: typing.Optional[bool] - boolean flag specifying whether to send the data retrieved to the webhook, or in the response request_options: typing.Optional[RequestOptions] - Request-specific configuration. ) ``` -------------------------------- ### Write Nutrition Log Data with Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md API documentation for the `client.nutrition.write` method, used to post nutrition logs to a provider. Currently, this functionality is available for Fitbit. ```APIDOC client.nutrition.write(...) Description: Used to post nutrition logs to a provider. Available for Fitbit ``` -------------------------------- ### API Reference: client.athlete.fetch Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md API documentation for the `client.athlete.fetch` method, which retrieves relevant profile information such as first & last name, birth date etc. for a given user ID. ```APIDOC client.athlete.fetch(...) Description: Fetches relevant profile info such as first & last name, birth date etc. for a given user ID Parameters: user_id: str - user ID to query data for to_webhook: typing.Optional[bool] - boolean flag specifying whether to send the data retrieved to the webhook, or in the response request_options: typing.Optional[RequestOptions] - Request-specific configuration. ``` -------------------------------- ### Authenticate User with Terra API (Python) Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This method creates a login link, enabling end users to connect their fitness tracking accounts. It initiates the necessary authentication flow to grant Terra access to user data. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.authentication.authenticateuser( resource="resource", ) ``` ```APIDOC client.authentication.authenticateuser( resource: str — resource to authenticate user with language: typing.Optional[str] reference_id: typing.Optional[str] auth_success_redirect_url: typing.Optional[str] auth_failure_redirect_url: typing.Optional[str] request_options: typing.Optional[RequestOptions] — Request-specific configuration. ) ``` -------------------------------- ### Retrieve All Terra User IDs with Optional Pagination Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This method fetches information for all registered Terra User IDs. It supports optional pagination using `page` and `per_page` parameters to manage large datasets. If `page` is not provided, all users are returned for backward compatibility. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.user.getalluserids() ``` ```APIDOC client.user.getalluserids(...) page: typing.Optional[int] — Zero-based page number. If omitted, results are not paginated. per_page: typing.Optional[int] — Number of results per page (default is 500). request_options: typing.Optional[RequestOptions] — Request-specific configuration. ``` -------------------------------- ### Generate Widget Session for Terra Authentication (Python) Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This function generates a redirect link for end users, allowing them to select an integration and log in with their fitness data provider. It is primarily used for embedding the Terra authentication widget into applications. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.authentication.generatewidgetsession() ``` ```APIDOC client.authentication.generatewidgetsession( providers: typing.Optional[str] — Comma separated list of providers to display on the device selection page. This overrides your selected sources on your dashboard language: typing.Optional[str] — Display language of the widget reference_id: typing.Optional[str] — Identifier of the end user on your system, such as a user ID or email associated with them auth_success_redirect_url: typing.Optional[str] — URL the user is redirected to upon successful authentication auth_failure_redirect_url: typing.Optional[str] — URL the user is redirected to upon unsuccessful authentication request_options: typing.Optional[RequestOptions] — Request-specific configuration. ) ``` -------------------------------- ### Write Activity Data to a Provider Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This method is used to post activity data to a specified provider. Currently, this functionality is available for Wahoo, enabling integration with external services. ```APIDOC client.activity.write(...) ``` -------------------------------- ### Delete Body Metrics Data using Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Illustrates how to initialize the Terra client and delete body metrics registered by a user on their account using the `client.body.delete` method. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.body.delete( user_id="user_id", ) ``` -------------------------------- ### Generate Authentication Token for Terra Mobile SDKs (Python) Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This function creates a token intended for use with initConnection() functions in Terra mobile SDKs. The token facilitates the creation of a user record for health platforms like Apple Health or Samsung Health. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.authentication.generateauthtoken() ``` ```APIDOC client.authentication.generateauthtoken( request_options: typing.Optional[RequestOptions] — Request-specific configuration. ) ``` -------------------------------- ### Fetch Sleep Data using Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Shows how to retrieve sleep data, including duration, stages, and quality, for a specified user ID and time range using the Terra Python client. Data can be sent to a webhook or returned in the response. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.sleep.fetch( user_id="user_id", start_date=1, ) ``` ```APIDOC client.sleep.fetch( user_id: str - user ID to query data for start_date: SleepFetchRequestStartDate - start date of data to query for - either ISO8601 date or unix timestamp end_date: typing.Optional[int] - end date of data to query for - either ISO8601 date or unix timestamp to_webhook: typing.Optional[bool] - boolean flag specifying whether to send the data retrieved to the webhook, or in the response with_samples: typing.Optional[bool] - boolean flag specifying whether to include detailed samples in the returned payload request_options: typing.Optional[RequestOptions] - Request-specific configuration. ) ``` -------------------------------- ### API Parameters for Data Deletion and Request Configuration Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Defines common parameters such as user ID, identifiers for log deletion, and general request options, likely applicable to various data manipulation API calls within the Terra client. ```APIDOC user_id: str — user ID to query data for log_ids: typing.Optional[typing.Sequence[str]] — List of identifiers for body metrics entries to be deleted request_options: typing.Optional[RequestOptions] — Request-specific configuration. ``` -------------------------------- ### Configure API Request Timeouts in Terra Python Source: https://github.com/tryterra/terra-client-python/blob/master/README.md This snippet illustrates how to set timeouts for API requests to prevent indefinite waiting. It shows how to configure a default timeout at the client initialization level and how to override it for specific method calls using `timeout_in_seconds` in `request_options`. ```python from terra import Terra client = Terra( ..., timeout=20.0, ) # Override timeout for a specific method client.integrations.fetch(..., request_options={ "timeout_in_seconds": 1 }) ``` -------------------------------- ### Terra User Update Parameters Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Defines parameters commonly used for updating a Terra user's details, including their user ID, an optional reference ID for system association, and their active status. This section outlines the structure for request-specific configurations. ```APIDOC user_id: str — Terra user ID to update reference_id: typing.Optional[str] — Identifier on your system to associate with this user active: typing.Optional[bool] — Whether the user should remain active request_options: typing.Optional[RequestOptions] — Request-specific configuration. ``` -------------------------------- ### API Reference: client.body.delete Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md API documentation for the `client.body.delete` method, used to remove Body metrics the user has registered on their account. ```APIDOC client.body.delete(...) Description: Used to delete Body metrics the user has registered on their account Parameters: user_id: str - user ID to query data for ``` -------------------------------- ### Access Raw API Response Data in Terra Python Source: https://github.com/tryterra/terra-client-python/blob/master/README.md This snippet shows how to access the raw HTTP response data, including headers and the underlying object, using the `.with_raw_response` property. This is useful for debugging, logging, or when detailed response information beyond the parsed data is needed. ```python from terra import Terra client = Terra( ..., ) response = client.integrations.with_raw_response.fetch(...) print(response.headers) # access the response headers print(response.data) # access the underlying object ``` -------------------------------- ### Delete Planned Workout Data using Terra Python SDK Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Illustrates how to delete existing workout plans for a specific user. This method supports deleting strength or cardio workouts by user ID and optional workout identifiers. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.plannedworkout.delete( user_id="user_id", ) ``` ```APIDOC client.plannedworkout.delete(user_id: str, data: typing.Optional[typing.Sequence[str]], request_options: typing.Optional[RequestOptions]) Description: Used to delete workout plans the user has registered on their account. This can be stregnth workouts (sets, reps, weight lifted) or cardio workouts (warmup, intervals of different intensities, cooldown etc) user_id: user ID to query data for data: List of identifiers for planned workout entries to be deleted request_options: Request-specific configuration. ``` -------------------------------- ### Delete Nutrition Logs using Terra Python Client Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md Illustrates how to delete nutrition logs that a user has registered on their account using the Terra Python client. This operation requires the user ID and optionally a list of specific entry identifiers. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.nutrition.delete( user_id="user_id", ) ``` ```APIDOC client.nutrition.delete( user_id: str - user ID to query data for data: typing.Optional[typing.Sequence[str]] - List of identifiers for nutrition entries to be deleted request_options: typing.Optional[RequestOptions] - Request-specific configuration. ) ``` -------------------------------- ### Modify Terra User Details (Python) Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This method allows updating a Terra user's reference_id or their active status. It provides functionality for managing user metadata within the Terra system. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.user.modifyuser( user_id="user_id", ) ``` ```APIDOC client.user.modifyuser( user_id: str request_options: typing.Optional[RequestOptions] — Request-specific configuration. ) ``` -------------------------------- ### Deauthenticate User from Terra (Python) Source: https://github.com/tryterra/terra-client-python/blob/master/reference.md This method deletes all records associated with a user on Terra's end, effectively revoking Terra's access to their data. It serves to log out the user and remove their data from the Terra system. ```python from terra import Terra client = Terra( dev_id="YOUR_DEV_ID", api_key="YOUR_API_KEY", ) client.authentication.deauthenticateuser( user_id="user_id", ) ``` ```APIDOC client.authentication.deauthenticateuser( user_id: str — user_id to deauthenticate for request_options: typing.Optional[RequestOptions] — Request-specific configuration. ) ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.