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.9.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.9.0.tar.gz.
File metadata
- Download URL: terrakio_api-0.9.0.tar.gz
- Upload date:
- Size: 2.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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 |
3de41fc823aa2e3fc617c20c2f3d2cf7d827ff4dd0eecf71b3de3e58f1c1a21c
|
|
| MD5 |
abd23915bd239eb832fc4f9788933ece
|
|
| BLAKE2b-256 |
4edae0f50eaa52f01f53c8a83e432764592c05421a98ed2f5099d73d801623a1
|
File details
Details for the file terrakio_api-0.9.0-py3-none-any.whl.
File metadata
- Download URL: terrakio_api-0.9.0-py3-none-any.whl
- Upload date:
- Size: 2.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via:
uv/0.12.5 {"installer":{"name":"uv","version":"0.12.5","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 |
ca5f3df06ff775fbc3cfca518660a22515ed940f8f99f9546e79eb253b804046
|
|
| MD5 |
30bcc6f519a6ab7e9587134287db8ead
|
|
| BLAKE2b-256 |
71cbee073da4291cd67fa370e2d8c0a2cf269ba0f8fa7f7d25736aa3abd16969
|