Skip to main content

Official Python client for the Geopera geospatial data platform

Project description

Geopera SDK (Python)

PyPI Python License: MIT

The official Python client for the Geopera geospatial data platform — satellite tasking & archive ordering, catalog search, the data platform, billing, and more. Every capability is a typed operation; this SDK gives you a fully typed, sync and async client for all of them.

  • Typed end-to-end — every operation has typed inputs, outputs, and errors (py.typed shipped).
  • Sync & async — call any operation with .sync() or await .asyncio().
  • Auth your way — a Geopera API key, or an OAuth bearer token from sign-in.
  • Generated from the live OpenAPI, so it never drifts from the API.

Install

pip install geopera

Requires Python 3.11+.

Quickstart

from geopera import AuthenticatedClient
from geopera.api.operations import catalog_search
from geopera.models import CatalogSearchInput

client = AuthenticatedClient(
    base_url="https://api.geopera.com",
    token="gpra_...",            # your Geopera API key
)

result = catalog_search.sync(
    client=client,
    body=CatalogSearchInput(
        host_name="api.geopera.com",
        collections=["sentinel-2-l2a"],
        limit=10,
    ),
)
print(result)   # -> CatalogSearchOutput (typed)

Every operation lives under geopera.api.operations.<operation_id> (dots become underscores — e.g. orders.tasking.estimateorders_tasking_estimate). Request/response models are in geopera.models. Browse the full operation reference at https://docs.geopera.com/api-reference.

Authentication

Pass either credential as token; Geopera accepts both and runs every call as that principal (with its scopes, audit, and provenance):

# 1) A Geopera API key (headless / server-to-server) — create one in the portal.
client = AuthenticatedClient(base_url="https://api.geopera.com", token="gpra_...")

# 2) An OAuth bearer token (e.g. from a signed-in user session).
client = AuthenticatedClient(base_url="https://api.geopera.com", token=user_access_token)

Async

import asyncio
from geopera import AuthenticatedClient
from geopera.api.operations import orders_tasking_estimate
from geopera.models import TaskingEstimateInput

async def main():
    async with AuthenticatedClient(base_url="https://api.geopera.com", token="gpra_...") as client:
        est = await orders_tasking_estimate.asyncio(
            client=client,
            body=TaskingEstimateInput(...),
        )
        print(est)

asyncio.run(main())

Error handling

Operations return either the typed success model or a typed error — Problem (RFC 9457 problem+json, what Geopera returns for business/permission errors) or HTTPValidationError (422 input validation). Use the *_detailed variant when you need the HTTP status code:

from geopera.api.operations import catalog_search
from geopera.models import CatalogSearchInput, Problem

resp = catalog_search.sync_detailed(client=client, body=CatalogSearchInput(...))
if resp.status_code == 200:
    data = resp.parsed              # CatalogSearchOutput
elif isinstance(resp.parsed, Problem):
    print("geopera error:", resp.parsed.title, resp.parsed.detail)

Configuration

AuthenticatedClient accepts the usual knobs (timeouts, retries via httpx, custom headers, TLS verification):

client = AuthenticatedClient(
    base_url="https://api.geopera.com",
    token="gpra_...",
    timeout=httpx.Timeout(30.0),
    raise_on_unexpected_status=True,
    headers={"X-Request-Source": "my-app"},
)

Versioning

The SDK version tracks the Geopera API contract. Breaking API changes bump the major version. See the changelog.

Links

License

MIT © Geopera

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

geopera-2.0.0.tar.gz (117.7 kB view details)

Uploaded Source

Built Distribution

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

geopera-2.0.0-py3-none-any.whl (585.5 kB view details)

Uploaded Python 3

File details

Details for the file geopera-2.0.0.tar.gz.

File metadata

  • Download URL: geopera-2.0.0.tar.gz
  • Upload date:
  • Size: 117.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for geopera-2.0.0.tar.gz
Algorithm Hash digest
SHA256 4cf3e6c2e8c104b733d277aba0c737f58a99c48b91cb4a87f87699472186172e
MD5 7ccbed39695e169aa5760ca04d23a1a7
BLAKE2b-256 2f1573068bb0a23822ec1f2871ac69ecd894e3d1366e83c469f8a9f533875e42

See more details on using hashes here.

Provenance

The following attestation bundles were made for geopera-2.0.0.tar.gz:

Publisher: publish.yml on geo-pera/geopera-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file geopera-2.0.0-py3-none-any.whl.

File metadata

  • Download URL: geopera-2.0.0-py3-none-any.whl
  • Upload date:
  • Size: 585.5 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for geopera-2.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a2ed3868dc408aa9cca2f2dc95d8733054e7dce0dac62668203c9d92ab26bdf8
MD5 fbb4bcd3bbb57a70eae050f1aedb692a
BLAKE2b-256 2398c30e836a10eb4b7a93b8385ef79ae9d243d34ecdb5fe8cb30397fad803a9

See more details on using hashes here.

Provenance

The following attestation bundles were made for geopera-2.0.0-py3-none-any.whl:

Publisher: publish.yml on geo-pera/geopera-python

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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