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.12.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.12.0.tar.gz.
File metadata
- Download URL: terrakio_api-0.12.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","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 |
b491cd99a889418ba7868f381dc322a3f4f93959d1d747f52bc352af67d87d40
|
|
| MD5 |
47f7356ff969dd7a412b88562ced60b9
|
|
| BLAKE2b-256 |
7ea901b0429b55a21804ec6804c2a7ddcd370d0786b9febb0195146326f230b3
|
File details
Details for the file terrakio_api-0.12.0-py3-none-any.whl.
File metadata
- Download URL: terrakio_api-0.12.0-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.8 {"installer":{"name":"uv","version":"0.12.8","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 |
add2ebf00b6b1548299ac2c896784afeff22fa21d5685c1b881d1d22202c64a8
|
|
| MD5 |
23b034c3636e9185db3dba188098cc4b
|
|
| BLAKE2b-256 |
fb1df1afb01fc0b881d7031f93c3ed18eba654138fe38e57f8df56011cb747bf
|