Skip to main content

geolens (Python SDK)

Auto-generated Python SDK for the GeoLens API.

Apache-2.0 licensed. Typed attrs-based dataclasses + httpx async-ready client + Bearer-token + API-key auth helpers.

See docs.getgeolens.com for installation, regeneration, and version-pin policy.

Quickstart

from geolens import GeolensClient

client = GeolensClient(base_url="https://geolens.example.com/api", bearer_token="...")
# The deployed API is served under /api, so include that suffix in base_url.
# See docs.getgeolens.com for endpoint usage examples.

Requests never time out unless you set one. Extra keyword arguments go to the generated client, so GeolensClient(base_url, bearer_token="...", timeout=httpx.Timeout(30.0)) bounds every call.

Errors

A documented error status (401, 403, 404, 422, 429 and so on) does not raise. sync() and asyncio() return a ProblemDetail with status, title and detail, and sync_detailed() returns it as .parsed next to the raw status_code:

from geolens.api.datasets import get_single_dataset_datasets_dataset_id_get as get_dataset
from geolens.models.problem_detail import ProblemDetail

result = get_dataset.sync(dataset_id, client=client.client)
if isinstance(result, ProblemDetail):
    print(result.status, result.title, result.detail)

Transport failures such as httpx.ConnectError do raise. A status the API doesn't document raises geolens.errors.UnexpectedStatus only when the client is built with raise_on_unexpected_status=True.

Downloading a COG

With a remote source behind a raster dataset, the COG download answers 302 with the file's URL. With S3 it may do the same when the server has presigned downloads enabled, and streams the file otherwise. cog_download fetches that URL without sending your GeoLens credentials to the storage host, and returns the file on every storage backend. A further redirect from the storage host is followed only on that same host. The file is streamed into a temporary file that moves to disk past a few MiB, so a large COG isn't held in memory:

import shutil

from geolens import cog_download

cog = cog_download.sync(dataset_id, client=client.client)  # or: await cog_download.asyncio(...)
with cog.payload as source, open("dataset.cog.tif", "wb") as target:
    shutil.copyfileobj(source, target)

Metadata

Release files for geolens 1.29.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for geolens 1.29.1
File Size Uploaded Provenance Actions
geolens-1.29.1.tar.gz 441.2 kB Without provenance Details for geolens-1.29.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for geolens 1.29.1
File Interpreter ABI Platform Actions
geolens-1.29.1-py3-none-any.whl Python 3 none any Details for geolens-1.29.1-py3-none-any.whl

Total release size: 1.8 MB

Release files / geolens-1.29.1.tar.gz

Download URL geolens-1.29.1.tar.gz
Size 441.2 kB
Tags Source
SHA-256 checksum
How to use checksums
af5dba4b575bf2690b8712e32eb87795c5aeba77c6aeb351cc5c7cff231b7c9d
BLAKE2b-256 checksum
How to use checksums
1f3da0f3ecc6b4c924cf434abd6f734949610a58bcf6266ec026f74ef3fad004
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / geolens-1.29.1-py3-none-any.whl

Download URL geolens-1.29.1-py3-none-any.whl
Size 1.3 MB
Tags Python 3
SHA-256 checksum
How to use checksums
632dbbbd3330b2484f474c3c9e8fa0ca76f0e28af0d50e36070e54dfac036a92
BLAKE2b-256 checksum
How to use checksums
1c3dbd40ea445d87b589b91ff4dbe62f5e9abf74e7c51da0d7aa6a39a46f9973
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.10.2 {"installer":{"name":"uv","version":"0.10.2","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for geolens 1.29.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.29.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page