Skip to main content
Pre-release

This release is a pre-release and may not be stable for production use.

abysshub

The official Python library for the Abyss API.

Pre-release: the Abyss API opens soon.

from abysshub import Abyss, AbyssError

abyss = Abyss()  # reads ABYSS_API_KEY

try:
    run = abyss.run("widget_131", {"amount": 250000})
    print(run.result)
except AbyssError as error:
    print(error.code, error.param, error.request_id, error.run)

run() presses the Widget and waits for the run to end, however long it takes, then returns the succeeded run. A refusal or a failed run raises AbyssError.

It runs on Python 3.10+, with one dependency, httpx.

The client

abyss = Abyss(api_key=None, base_url=None, max_retries=2)
  • api_key: defaults to ABYSS_API_KEY. Without a key, Abyss() raises AbyssError with code == "invalid_api_key".
  • base_url: defaults to ABYSS_BASE_URL, else https://api.abysshub.com. A key starting abyss_sk_dev_ goes to https://api.dev.abysshub.com.

abyss.close() closes its connections; with Abyss() as abyss: does it for you.

Running a Widget

run = abyss.run(widget, input, max_price=None, idempotency_key=None)
  • widget is widget_<id>, or an unlisted Widget's private token.
  • input is the Widget's Fields by name, as a dict.
  • max_price: the most the run may cost, in Byssium. A higher price is refused with price_above_max, and nothing is charged.
  • idempotency_key: each call presses with a fresh UUID Idempotency-Key unless you give one.

The press holds until the run ends. When the hold ends early (a deploy cuts it, the API's holds are all taken, or an hour passes), run() re-attaches with GET <Location>?wait=true until the run ends. Re-attaching has no limit and is not a retry. Connecting has 10 s, and 30 s of silence counts as a cut.

A run is a dataclass with /v1's fields: id, widget, status (queued, running, succeeded or failed), price, result (the Widget's JSON, a dict when it wrote an object), output_files, error, created_at, started_at and ended_at.

Files

from abysshub import Abyss, file

run = abyss.run("widget_1660", {
    "report": file("report.pdf"),
    "data": [file("jan.csv"), file(csv_bytes, filename="feb.csv"), "https://example.com/sales/mar.csv"],
})
paths = run.save("output")  # [Path("output/charts/a.png"), Path("output/output.json")]
  • file(path) is a file on disk, read when it is uploaded. A file Field also takes a Path, an open file (open("report.pdf", "rb")) or bytes. file(data, filename=...) names data. A file without a name uploads under its Field's name.
  • A string passes through as an https URL or an upload id. A multi-file Field takes a list, which may mix all three kinds.
  • Before the press, each file is uploaded with POST /v1/widgets/{widget}/uploads, then sent to storage, in parallel, and its id goes in the input. An upload refusal (held_input_*) raises before any press. A press that drops before any headers is sent again with the same ids; it never uploads again.
  • run.save(dir) writes every output file under dir at its path, making folders, and returns the paths it wrote.
  • Each of run.output_files has f.save(path) and f.read(), which returns bytes. An expired URL is refreshed once, by reading the run again with GET /v1/runs/{id}.

Errors

A refusal or a failed run raises one AbyssError. Branch on code:

  • code, message, param, doc_url, request_id: from /v1's error body. A failed run's code is widget_fault, platform_fault or budget_exceeded.
  • status: the HTTP status of a refusal; None for a failed run.
  • run: the failed run; None for a refusal.

The library's own codes: invalid_api_key (no key), connection_error (the connection dropped before the API answered) and unexpected_response (an answer that is not /v1's).

Metadata

Release files for abysshub 0.0.1.dev9

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

Source distribution (sdist)

Source distribution for abysshub 0.0.1.dev9
File Size Uploaded
abysshub-0.0.1.dev9.tar.gz 15.5 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for abysshub 0.0.1.dev9
File Interpreter ABI Platform
abysshub-0.0.1.dev9-py3-none-any.whl Python 3 none any Details

Total release size: 27.8 kB

Release files / abysshub-0.0.1.dev9.tar.gz

Download URL abysshub-0.0.1.dev9.tar.gz
Size 15.5 kB
Tags Source
SHA-256 checksum
How to use checksums
a51968c2e55e2c70af0a982c4de05a6c85b7b88f3fb4fe1a2fec240578f184e0
BLAKE2b-256 checksum
How to use checksums
4bed6ce13b02486c8ffc303be80e096ccbf1f6a3fbaff3c5eec836f803ca2c12
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log

Release files / abysshub-0.0.1.dev9-py3-none-any.whl

Download URL abysshub-0.0.1.dev9-py3-none-any.whl
Size 12.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
20ea4bd7fb19323e74e9d8da700061539a5f66b860d88f753b4e3dcbcaaa8533
BLAKE2b-256 checksum
How to use checksums
b99f955e3d8de2a3bc15c02ee47a2757a2fb3ba486c34921d97d961faaaa5d88
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

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.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 5, 2026.

Transparency log
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