Skip to main content

UI-free HTTP client for SEPAL platform services (user files, tasks, processing recipes).

Project description

pysepal-api

UI-free HTTP client for SEPAL platform services. Powers Jupyter notebooks, Voila apps, CLI scripts, and background jobs running inside a SEPAL sandbox.

from pysepal_api import SepalClient

# sync — notebooks, CLI, jobs
with SepalClient(session_id="...") as sepal:
    listing = sepal.files.list("/")
    task = sepal.tasks.submit("image.download", params={...})
    sepal.tasks.wait(task.id)

    # escape hatch: any route the typed endpoints don't model
    image = sepal.get("/api/gee/image/json", params={"recipeId": "foo"}).json()
from pysepal_api import AsyncSepalClient

# async — Voila / Solara
async with AsyncSepalClient(session_id="...") as sepal:
    listing = await sepal.files.list("/")
    image = (await sepal.get("/api/gee/image/json", params={"recipeId": "foo"})).json()

The two clients are twins: identical surface, the only difference is await.

  • Scoped usewith SepalClient(...) / async with AsyncSepalClient(...). Construction never performs network I/O; entering the context creates the module results dir (when module_name is given).
  • Long-lived clientssepal = SepalClient.create(...) / sepal = await AsyncSepalClient.create(...): same eager setup without a context manager; call close() / aclose() when done. async with AsyncSepalClient.create(...) also works.
  • Typed endpoints for the common cases: files, tasks, recipes. File verbs follow pathlib: read_bytes / read_text / read_json / write / mkdir.
  • Generic primitiverequest() / get() / post() / put() / delete() — for any other SEPAL route, with the same typed-error mapping (NotFound, Unauthorized, …). Returns the raw httpx.Response.
  • One exception root — catch PysepalError for anything this library raises.

TLS is verified by default. host.docker.internal is auto-skipped for local dev; for any other self-signed host pass verify=False or list it in PYSEPAL_INSECURE_TLS_HOSTS (comma-separated, exact-host match).

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

pysepal_api-0.2.0.tar.gz (25.1 kB view details)

Uploaded Source

Built Distribution

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

pysepal_api-0.2.0-py3-none-any.whl (19.4 kB view details)

Uploaded Python 3

File details

Details for the file pysepal_api-0.2.0.tar.gz.

File metadata

  • Download URL: pysepal_api-0.2.0.tar.gz
  • Upload date:
  • Size: 25.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pysepal_api-0.2.0.tar.gz
Algorithm Hash digest
SHA256 390889963c232a2788592e131ffe33076668cee27b9f33e2951eb2ffd773564c
MD5 906afc48ba1c12bfdbadc6e8f5ac829f
BLAKE2b-256 64e51e15f697099e17b1c640dc18498247bda2e8b96db0e986775ecbd697eb34

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysepal_api-0.2.0.tar.gz:

Publisher: release.yml on dfguerrerom/pysepal-api

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

File details

Details for the file pysepal_api-0.2.0-py3-none-any.whl.

File metadata

  • Download URL: pysepal_api-0.2.0-py3-none-any.whl
  • Upload date:
  • Size: 19.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for pysepal_api-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 4bfda96ae9a87fed866d8c2fcde44239c6c21e0c5cdd969fc8fe856f177ad969
MD5 813eb73641cf6bdd0c14f0254fb5441f
BLAKE2b-256 becbf177df997b05ddc59ff7b62c295a2bd0bd22049113e51ee9bf98a9f49705

See more details on using hashes here.

Provenance

The following attestation bundles were made for pysepal_api-0.2.0-py3-none-any.whl:

Publisher: release.yml on dfguerrerom/pysepal-api

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