Document Toolkit · v0.2.0 Latest
eDocAPI

Document processing
made simple

eDocAPI is a document processing library and lightweight API framework. Convert DOCX, HTML, Markdown, images and PDFs, extract text, run OCR, compress and merge through a simple App API. Just you and your documents.

$ pip install edocapi

What eDocAPI actually does

A focused document toolkit — convert, extract, OCR, compress, merge — and a lightweight App for building document APIs.

Document Conversion

DOCX → PDF with ReportLab layout (preserves headings, tables, page breaks). HTML & Markdown → PDF. Images → PDF. Optional renderers are available for richer output.

Text Extraction

Pull clean text from PDFs, DOCX, HTML, Markdown and more. Simple .extract_text() that just works.

OCR (optional)

OCR for scanned PDFs and images uses the external Tesseract program. Install edocapi[ml] and Tesseract; PDF page rendering may also require edocapi[pdf-images] and Poppler. The API OCR route is enabled with App(enable_ocr=True).

Compress & Merge

Compress PDFs and images, with an optional best-effort target size that depends on the input and output format. Merge multiple PDFs into one.

Lightweight App

Build document APIs with a tiny App class. Interactive developer dashboard included out of the box.

Security First

File-signature and extension checks, path sanitization, size limits, collision-resistant temporary names, and automatic cleanup.

Why developers reach for eDocAPI

Most document libraries pull in heavy dependencies or force complex setups. eDocAPI brings document tools and a simple App together when you need an API — so you stay in control of your workflow.

  • Lightweight by design

    Install only the optional features you need, with a focused core for document workflows.

  • DOCX → PDF without GTK

    ReportLab-based layout converts DOCX files without requiring WeasyPrint’s native libraries. Output preserves supported headings, tables, and page breaks.

  • Security that is actually useful

    File-signature checks, path sanitization, size limits, temporary-file isolation, and safe response headers help make document handling more predictable.

  • Built in Nigeria, for everyone

    Created by Emmanuel Emmanuel Etim. Open source, MIT licensed, and designed to stay lightweight and honest.

library.py
from edocapi import Document

# From a file
doc = Document("report.docx")
pdf = doc.to_pdf()
text = doc.extract_text()
info = doc.info()

# From in-memory content
doc = Document.markdown("# Hello\n\nWorld")
pdf = doc.to_pdf()

# OCR (pip install edocapi[ml])
text = Document("scan.png").ocr(lang="eng")

# Merge & compress
merged = Document.merge(["a.pdf", "b.pdf"])
small  = Document("large.pdf").compress(target_size=500_000)
Changelog

Journey to v0.2.0

What was actually shipped — from the first public versions to the current release.

v0.2.0 Latest v0.1.1 v0.1.0 v0.0.2
EDOCAPI RELEASE NOTE Latest · v0.2.0 2026-10-17

Reliability, security & release quality

Predictable failures, safer uploads, blocked resource fetches during rendering, rate limits, streaming cleanup, and CI across Python 3.10–3.13.

Security Rate limits Upload validation CI & tests Streaming
PREVIOUS RELEASE v0.1.1 2026-10-15

Independence & power

ASGI app, OCR, converters, security hardening, CLI, and interactive dashboard.

v0.2.0 Current 2026-10-17

Reliability & security

  • • Predictable errors for missing, empty, encrypted, or unsupported docs
  • • Strict extension, size, encoding, and signature validation
  • • Block local/remote resource fetches in HTML, Markdown & DOCX PDF
  • • Streamed multipart uploads with per-file and total request limits
  • • Rate limits (global + per-route); 429 + Retry-After; /health exempt
  • • Configurable max_request_size (100 MiB default)
  • • CI on Python 3.10–3.13 + regression tests for uploads & cleanup
v0.1.1 2026-10-15

Independence & Power

  • • A focused document-processing package with optional integrations
  • • Improved security (magic-byte, path sanitization, size limits)
  • • Optional OCR with Tesseract + OpenCV pre-processing
  • • Smarter image compression & enhanced DOCX/HTML/Markdown → PDF
  • • ReportLab-based DOCX to PDF conversion
  • • Professional CLI: convert · extract · info · ocr · compress
  • • Interactive dashboard with feature summary & /health
  • • DOCX tables with borders, repeating headers, readable TOC
v0.1.0

First solid public release

  • • Core Document abstraction (to_pdf, extract_text, compress, merge…)
  • • App class for building document APIs
  • • Developer dashboard with “Try it” explorer
  • • CLI: edocapi run
  • • Support for PDF, DOCX, HTML, Markdown, images, TXT
  • • Optional WeasyPrint & pdf2image extras
v0.0.2

Early foundation

  • • First public packaging on PyPI
  • • Basic Document + App for document APIs
  • • convert / extract / compress / merge endpoints
  • • Supported formats table established
  • • CLI and development workflow

Supported formats (v0.2.0)

What each operation can do today.

Format to_pdf extract_text OCR compress merge to_images
PDF✓✓✓*✓✓✓*
DOCX✓✓––––
HTML✓✓––––
Markdown✓✓––––
TXT✓✓––––
JPEG / PNG / WebP✓✓*✓*✓––

OCR requires optional OCR engines: Tesseract with edocapi[ml] or PaddleOCR with edocapi[structured-ocr]. Tesseract OCR for scanned PDF pages may also need edocapi[pdf-images] and Poppler. PDF to_images() requires edocapi[pdf-images] and Poppler.

Quick Start

Library or API server — both are one install away.

1

Install

$ pip install edocapi

Optional: edocapi[html] · edocapi[ml] · edocapi[server] · edocapi[all]

2

Use the library

from edocapi import Document

doc = Document("report.docx")
pdf = doc.to_pdf()
text = doc.extract_text()
3

Or run an API server

from edocapi import App, Document

app = App()

@app.post("/convert")
def convert(file):
    return Document(file).to_pdf()
$ pip install edocapi[server]
$ uvicorn main:app --reload

Open http://127.0.0.1:8000 for the interactive developer dashboard.

CLI

Command line

edocapi --version
edocapi convert report.docx -o report.pdf
edocapi extract report.pdf
edocapi info image.png
edocapi ocr scan.png --lang eng
edocapi compress large.pdf --target 500KB

Start processing documents today

One package. Clean API. Real security. Built by a Nigerian developer who cares about simplicity.