No description
  • Python 96%
  • Dockerfile 4%
Find a file
2026-04-20 05:18:47 +08:00
.forgejo/workflows chore: update ci 2026-04-20 05:12:22 +08:00
.vscode init app 2026-04-20 04:24:17 +08:00
app feat: setup simple rate limiter 2026-04-20 05:18:47 +08:00
tests ci and tests 2026-04-20 05:00:46 +08:00
.gitignore init app 2026-04-20 04:24:17 +08:00
.python-version init app 2026-04-20 04:24:17 +08:00
docker-compose.yml setup docker deploy 2026-04-20 05:00:33 +08:00
Dockerfile setup docker deploy 2026-04-20 05:00:33 +08:00
LICENSE add license 2026-04-20 05:04:54 +08:00
pyproject.toml ci and tests 2026-04-20 05:00:46 +08:00
README.md init app 2026-04-20 04:24:17 +08:00
uv.lock ci and tests 2026-04-20 05:00:46 +08:00

docs-api

A documents management and extraction API.

PDFs are processed with PyMuPDF4LLM; all other formats are handled by Pandoc.

Requirements

  • Python 3.13+
  • uv

Running

uv sync
uv run fastapi dev app/main.py

Endpoints

GET /

Health check. Returns a description string.


POST /extract/

Converts a remote document to Markdown.

Request body (application/json):

Field Type Description
file_url string Publicly accessible URL to a file.

Response: text/markdown with the extracted content.

Example:

curl -X POST http://localhost:8000/extract/ \
  -H "Content-Type: application/json" \
  -d '{"file_url": "https://example.com/document.pdf"}'

Error responses:

Status Reason
400 URL unreachable, unsupported content type, or file exceeds 10 MB
500 Conversion failed

Supported Formats

The API accepts files whose Content-Type matches one of the following:

Format MIME Type
PDF application/pdf
DOCX application/vnd.openxmlformats-officedocument.wordprocessingml.document
ODT application/vnd.oasis.opendocument.text
PPTX application/vnd.openxmlformats-officedocument.presentationml.presentation
XLSX application/vnd.openxmlformats-officedocument.spreadsheetml.sheet
EPUB application/epub+zip
HTML text/html
Markdown text/markdown
LaTeX text/x-tex
reStructuredText text/x-rst
CSV text/csv
TSV text/tab-separated-values
JSON application/json
XML application/xml
RTF application/rtf
Org text/org
Typst application/x-typst
Jupyter Notebook application/x-ipynb+json
BibTeX / BibLaTeX application/x-bibtex
…and more (all formats supported by Pandoc)

File size limit: 10 MB


© 2026 | tbdsux