doconda SDK with your function and call doconda.documents.create(...) in the handler. The call waits
until the Word, PowerPoint or Excel file is ready, and documents.download returns its bytes to store in S3. The
function needs no Office libraries: Doconda builds the file and its PDF.
Steps
- Put your Doconda API key (dashboard → API keys) in the function’s
DOCONDA_API_KEYenvironment variable, preferably from a secret. - Package the SDK. It needs Python 3.9 or later and its only dependency is
httpx:pip install doconda -t package/, then addlambda_function.pyto the zip. - Write the handler:
prompt instead of content.
Set the timeout for the quality level
How long the call takes depends on the quality level:
Without
quality, Doconda picks the level (auto); from content alone it uses standard. Raise the function’s
timeout to cover the level you use; Lambda allows up to 15 minutes.
To keep the function short, call doconda.documents.create_in_background(...), which answers at once with the
document id, and register a webhook with doconda.webhooks.create(url) to hear when it finishes.
What you get back
status:ready, orfailedwitherror.codeanderror.message. Failed documents are not charged.doc["outputs"]: the file and its PDF, as links valid 5 minutes.documents.outputs(id)returns fresh ones.documents.download(id, "xlsx")or"pdf": the bytes of that output.
FAQ
Do I need python-docx, python-pptx or openpyxl?
Do I need python-docx, python-pptx or openpyxl?
No. The SDK only makes HTTP calls; Doconda returns the finished, editable file and its PDF.
Does the SDK retry on network errors?
Does the SDK retry on network errors?
Yes. Network errors,
429 and 5xx on reads and create are retried twice by default (max_retries=2) before
raising DocondaError. Conversions and uploads go out once, so they never run twice.Where are the documents stored?
Where are the documents stored?
In the European Union (Ireland), and the AI that processes them also runs in the EU.
Related
- Python SDK: every method.
- Amazon Bedrock: when the Lambda runs a Bedrock agent.
- Pricing.