doconda lets you create, edit and convert Word, PowerPoint, Excel and PDF files from Python. It calls the
REST API for you, with retries and waiting built in. It runs on Python 3.9 or later
(AWS Lambda, Cloud Run and notebooks included), and its only dependency is httpx.
Create your first document
1
Create an API key
In the dashboard, go to API keys and create one. The full key (
ak_eu_…) is shown only once. Export it:2
Install the SDK
3
Make the request
Create a file named
example.py and add the following code:example.py
create takes the body of POST /documents as keyword arguments and waits until the
document finishes. Every response is a dict with the API’s fields: doc.id in TypeScript is doc["id"] here.
Configure the client
The client holds a connection pool: use it as a context manager (
with Doconda() as doconda:) or call
doconda.close() when you’re done.
Edit a file
edited is a new document; your uploaded file stays as it was. See Edit a file.
Convert a file
convert turns a file into another format with no AI. The first 1,000 conversions each month are free, then €0.01
each. It takes a path, bytes (with filename), a public URL, a file_… or a doc_…, and waits while a scan is read
with OCR.
md, txt, html and csv come back in text; other formats in output. See Convert files.
Follow the progress
create_in_background answers at once with status: "queued". events yields each event and ends when the document
finishes; wait(id) blocks until then and returns the document. See events.
Give your agent tools
doconda.tools() returns eight tools: create_document, upload_file, convert_file, edit_document,
list_documents, get_document, get_report and read_artifact_data. Each Tool has name, description,
input_schema (JSON Schema) and run(args).
create_document and edit_document wait up to wait_seconds (240 by default) for the document. One still being
made by then comes back with its id, status and a note, and the model calls get_document later.
run doesn’t raise on an API error. It returns {"error": "<code>", "message": "<text>", "fields": [...]}, with
fields only on validation errors, so the model can correct its call. To plug them in, see
Amazon Bedrock, Vertex AI, OpenAI, Claude or
LangChain.
Verify webhooks
verify_webhook returns the event, or raises ValueError when the signature doesn’t match or the timestamp is more than
300 s off. See Webhooks.
Handle errors
An error response from the API raisesDocondaError with status, code, errors and request_id; str(e) is the
message. 429 and 5xx on reads and create are retried before it’s raised.
status: "failed". See
Errors and retries.
Next steps
Create documents
From a sentence or your Markdown, in any format.
Edit a file
Upload a file and change only what you ask.
Build artifacts
Web pages with their own data.
SDK reference
Every method, in TypeScript and Python.