Skip to main content

A python wrapper for the Terra API.

Project description

GitHub license docs

Terra Python Package

A wrapper in python for the Terra endpoints and models.

User Guide: https://docs.tryterra.co/docs/python-project-1

Install using

pip install terra-python

Then import the Terra class from terra.base_client

Initialise a new Terra instance with:

from terra.base_client import Terra

# For user authentication
terra = Terra(api_key='YOUR API KEY', dev_id='YOUR DEV ID');

# For web hook endpoints
terra = Terra(api_key='YOUR API KEY', dev_id='YOUR DEV ID', secret='YOUR TERRA SECRET');

Now you can call the following functions from the instance:

  • from_user_id
  • get_activity_for_user
  • get_body_for_user
  • get_daily_for_user
  • get_sleep_for_user
  • get_athlete_for_user
  • get_menstruation_for_user
  • get_nutrition_for_user
  • generate_widget_session
  • generate_authentication_url
  • get_user_info
  • deauthenticate_user
  • list_users
  • list_providers
  • check_terra_signature
  • handle_flask_webhooks
  • handle_webhooks

The documentation for the wrapper is available here: https://tryterra.github.io/terra-client-python/

In addition, all the data models documented on [https://docs.tryterra.co/docs/data-models] are available to import and use.

The models support autocompleting the types to manipulate data coming from Terra

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

terra_python-0.0.16.tar.gz (481.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

terra_python-0.0.16-py3-none-any.whl (33.8 kB view details)

Uploaded Python 3

File details

Details for the file terra_python-0.0.16.tar.gz.

File metadata

  • Download URL: terra_python-0.0.16.tar.gz
  • Upload date:
  • Size: 481.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for terra_python-0.0.16.tar.gz
Algorithm Hash digest
SHA256 810f0f8f0eb9cffa1671ef5577ea80fe9a83a1a13a516f810567e6f15d873c20
MD5 4565d555760380b6797e2d8e09ae9f25
BLAKE2b-256 220f35aba950409aacb08329c85deb8a7e113324aaefeb994380534c376b63f3

See more details on using hashes here.

File details

Details for the file terra_python-0.0.16-py3-none-any.whl.

File metadata

  • Download URL: terra_python-0.0.16-py3-none-any.whl
  • Upload date:
  • Size: 33.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: python-requests/2.32.3

File hashes

Hashes for terra_python-0.0.16-py3-none-any.whl
Algorithm Hash digest
SHA256 3d6036e221f0c1cd83da87a6a9186fcf6b57ae4952ea6cef8d035ef878bbcfcf
MD5 9ddb94cbcf9fa48ae022b4c6b8996159
BLAKE2b-256 41b07c85773000722d4c527e7e4c611bbaa8bce7a75b17ac4cf8687069a3320c

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page