Metadata-Version: 2.5
Name: doconda
Version: 0.1.0
Summary: Python SDK for Doconda: generate, review and edit Word, PowerPoint, Excel and PDF documents from AI agents (Amazon Bedrock, Vertex AI, OpenAI, Claude, LangChain).
Project-URL: Homepage, https://doconda.com
Project-URL: Documentation, https://docs.doconda.com/en/sdk/python
License-Expression: MIT
License-File: LICENSE
Keywords: ai-agents,anthropic,bedrock,document-generation,docx,excel,langchain,llm,mcp,openai,pdf,powerpoint,pptx,tools,vertex-ai,word,xlsx
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Office/Business
Classifier: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# doconda

Generate, review and edit **Word (DOCX), PowerPoint (PPTX), Excel (XLSX) and PDF** documents from your AI agent or chatbot, with one call. Editable files with real Word styles, reviewed before they are delivered.

Use it when your agent has to hand the user a document and you don't want to maintain python-docx, python-pptx, openpyxl or templates. Works with Amazon Bedrock, Vertex AI, OpenAI, Claude, Gemini, LangChain, CrewAI and any model with tool calling.

```bash
pip install doconda
```

```python
from doconda import Doconda

doconda = Doconda()  # reads DOCONDA_API_KEY
doc = doconda.documents.create(format="docx", prompt="Report on the housing law")
print(doc["outputs"])  # links to the Word file and the PDF

open("report.docx", "wb").write(doconda.documents.download(doc["id"], "docx"))
```

## As tools for your agent

`doconda.tools()` returns ready-made tools (name, description, JSON Schema, `run`) to create, review and edit documents. With Amazon Bedrock (Converse API):

```python
import json
import boto3
from doconda import Doconda

bedrock = boto3.client("bedrock-runtime")
tools = Doconda().tools()
tool_config = {
    "tools": [
        {"toolSpec": {"name": t.name, "description": t.description, "inputSchema": {"json": t.input_schema}}}
        for t in tools
    ]
}
messages = [{"role": "user", "content": [{"text": "Make an Excel with the event budget"}]}]

while True:
    res = bedrock.converse(modelId=MODEL_ID, messages=messages, toolConfig=tool_config)
    message = res["output"]["message"]
    messages.append(message)
    if res["stopReason"] != "tool_use":
        break
    results = []
    for block in message["content"]:
        if "toolUse" in block:
            use = block["toolUse"]
            out = next(t for t in tools if t.name == use["name"]).run(use["input"])
            results.append(
                {"toolResult": {"toolUseId": use["toolUseId"], "content": [{"text": json.dumps(out)}]}}
            )
    messages.append({"role": "user", "content": results})
```

The same tools plug into Vertex AI / Gemini, OpenAI, Claude, LangChain or CrewAI: see the guides.

## What else

- `documents.create(operation="review", file=…)` and `operation="edit"`: review and fix, or change, an existing Word, PowerPoint, Excel or PDF.
- `documents.stream(…)`: the document's events as they happen.
- `extract(file)`: any file to Markdown for your model (free).
- `files.upload(path_or_bytes)`, `webhooks.create(url)` and `verify_webhook(body, headers, secret)`.

Docs: https://docs.doconda.com/en/sdk/python · Guides per stack: https://docs.doconda.com/en/agents/introduction · Get an API key: https://doconda.com
