Terrakio API Client
A Python client for Terrakio API. This package provides a user-friendly interface for accessing Terrakio's data services.
Features
- Authentication
- WCS queries and data retrieval
- Mass stats related functionalities
Installation
pip install terrakio-api
Usage Example
from terrakio_api import Client
from shapely.geometry import Point
# Initialize the client
client = Client() # defaults to https://dev-omni.terrak.io (fronts all regions)
# or name an environment: Client(env="prod" | "candidate" | "dev-au" | "local" | …),
# settable for a whole session with TERRAKIO_ENV
# Login to your account
client.auth.login(email = "XXX", password = "XXX")
print("✓ Login successful")
# The login account will automatically be used for the requests
# View API key
api_key = client.auth.view_api_key()
print(f"✓ Current API key: {api_key[:10]}...")
# Create an extra API key (the full key is returned only here, so store it now)
new_key = client.keys.create_key(label="my laptop")
print(f"✓ New API key: {new_key['key']}")
# List your keys (metadata only) and revoke one
for key in client.keys.list_keys():
print(key["id"], key["prefix"], key["label"])
client.keys.revoke_key(key_id=new_key["id"])
# To rotate a key: create a new one, switch your code over to it, then revoke the old one.
# Create a geographic feature
point = Point(149.057, -35.1548)
# Make a WCS request
dataset = client.geoquery(
expr="prec=MSWX.precipitation@(year=2024, month=1)\nprec",
feature=point,
output="netcdf"
)
For more documentation, see the main repository.
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
terrakio_api-0.11.0.tar.gz
(2.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file terrakio_api-0.11.0.tar.gz.
File metadata
- Download URL: terrakio_api-0.11.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
941a089801842b18455314f81d857a3d15eb5e5497d8162c14ea50041cca3606
|
|
| MD5 |
1dd7f4db505edf7b2cb834baf1014ece
|
|
| BLAKE2b-256 |
1d36a3928d42287b65712358056c8139d889b91ffa0e957755d411d8415f7d8b
|
File details
Details for the file terrakio_api-0.11.0-py3-none-any.whl.
File metadata
- Download URL: terrakio_api-0.11.0-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.6 {"installer":{"name":"uv","version":"0.12.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5e3bb7aa34329179133173c021321fe6dbc759ca6d46b4bdb11ea78754ebb8e5
|
|
| MD5 |
f43766935b92afc3e1847c3e5f13a46a
|
|
| BLAKE2b-256 |
861dd3060370ea465454f794df94cbd363a9e2c9b16e3e2eb227b7fbe8ec72dc
|