Skip to content

yasir-ai/AutoDoc-API

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 

Repository files navigation

📝 AutoDoc API

A FastAPI based docx editor. Edit, highlight, and annotate .docx files in seconds with literally a simple & fast API. Super good for programmatic document review or edits.

FastAPI License: MIT Python Status Built By


🚀 Features

Allows any Custom GPT to call it and process documents at scale to:

  • 🔄 Replace, inject, and edit text in .docx files
  • 🎯 Highlight key sections
  • 💬 Append inline notes dynamically
  • ☁️ Uploads the modified files to file.io and returns a public download link

📦 Quickstart

1-Click Deploy (Cloud)

Deploy to Vercel

Local Deployment

pip install -r requirements.txt
uvicorn main:app --reload

Then go to: http://localhost:8000/docs

Upload a .docx and your edits JSON, and boom -> instant doc enhancement

Example JSON

{
  "replacements": {
    "Hello": "Hi",
    "world": "Earth"
  },
  "highlightSections": [
    "important",
    "note"
  ],
  "inlineNotes": {
    "FYI": "This was added per client request."
  }
}

🧪 API Sauce

Field Type Description
file File .docx file to be edited
edits string JSON string with instructions

Returns: {"downloadUrl": "https://file.io/abc123"}

How to send requests to this jawn

cURL request example

curl -X POST https://your-vercel-url.vercel.app/modify-docx \
  -F "[email protected]" \
  -F 'edits={
    "replacements": {"Hello": "Hi"},
    "highlightSections": ["important"],
    "inlineNotes": {"FYI": "This is a note"}
  }'

Make sure:

  1. Your docx file is named example.docx
  2. You format your edits as a valid JSON string

Python request example

import requests

url = "https://your-vercel-url.vercel.app/modify-docx"
files = {"file": open("example.docx", "rb")}
data = {
    "edits": '''
    {
        "replacements": {"Hello": "Hi"},
        "highlightSections": ["important"],
        "inlineNotes": {"FYI": "This is a note"}
    }
    '''
}

response = requests.post(url, files=files, data=data)

print(response.json())

pro tip

If you're using a custom GPT to send JSON instructions… you're already ahead of the game. Add OpenAI or LLM support and you've got a document editing co pilot

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages