Skip to main content
The dreep package wraps every endpoint in this reference, adds typed errors, and generates signed URLs correctly — including the one detail that is easy to get wrong by hand (see Signed URLs).
  • Sync and async. Dreep and AsyncDreep share one API. Async runs on asyncio and trio.
  • Fully typed. Ships py.typed. Transforms are a TypedDict with Literal values, so fit="squish" fails type checking before it ships.
  • One dependency. httpx, and nothing else.

Installation

Or with uv or Poetry:
Requires Python 3.10 or later.

Authentication

Create an API key on the API Keys page of your dashboard.
Both arguments fall back to environment variables, so the usual setup is simply:
Your API key is a full-project credential and must stay server-side. Anyone holding it can read, upload and delete every asset in the project. It never appears in logs or in the client’s repr().To upload from a browser, use the presigned upload flow, where your backend hands the client a short-lived URL and the key never leaves your server.

Quickstart

file can be bytes, a pathlib.Path, or a binary file object. A plain str is rejected on purpose, because it could be either a path or the file’s content.

Async

AsyncDreep mirrors the sync client method for method, including the lazy iterator:
Both clients are context managers. Outside a with block, call client.close() (or await client.aclose()) when you are done, or hand in your own httpx client and keep ownership of it.

Method reference

Every method takes keyword-only arguments after the file, so adding an argument never changes the meaning of the others.

Responses

Responses come back as frozen dataclasses with snake_case attributes. Numbers the API sends as strings (sizeBytes: "245000" — Postgres BIGINT serialises that way over JSON) are converted to int, so a.size_bytes + b.size_bytes adds rather than concatenating. Any field the SDK doesn’t model yet is still available on .raw:

Timeouts

JSON calls time out after 30 seconds. Uploads don’t — a large file can legitimately take minutes — so pass timeout= on the call to bound one:
See Errors & Retries for what is retried and what deliberately isn’t.