AccessPDF
Make PDFs accessible. Fixes structure, reading order, tables, and headings automatically -- then helps you add image descriptions with local AI or by hand.
Targets WCAG 2.1 AA and PDF/UA.
Quick start
pip install accesspdf
accesspdf serve
This opens a browser UI at http://localhost:8080. Upload a PDF, get an accessibility report, download the fixed version. If your PDF has images, you can write alt text right in the browser -- or let AI do a first draft.
For AI-generated alt text, we recommend Ollama -- it's free, runs locally, and needs no API key. Install it, then:
ollama pull llava
That's it. Select "Ollama" in the web UI and click generate.
How it works
AccessPDF does two things:
- Fixes structure automatically -- tags, language, reading order, headings, tables, links, bookmarks
- Helps you add image descriptions -- the one part that needs a human (or AI + human review)
Your original PDF is never modified. Output always goes to a new file.
CLI workflow
If you prefer the command line over the web UI:
# 1. See what's wrong (read-only, never touches your file)
accesspdf check my-document.pdf
# 2. Fix structural issues
accesspdf fix my-document.pdf -o my-document_accessible.pdf
# 3. Generate AI alt text drafts (optional)
accesspdf generate-alt-text my-document_accessible.pdf
# 4. Review and approve the drafts
accesspdf review my-document_accessible.pdf
# 5. Re-run fix to inject approved descriptions
accesspdf fix my-document.pdf -o my-document_accessible.pdf --alt-text my-document.alttext.yaml
AI alt text providers
AccessPDF uses AI vision models to draft image descriptions. You always review before anything gets injected.
| Provider | Setup | API key? | Cost |
|---|---|---|---|
| Ollama (recommended) | Install Ollama, ollama pull llava |
No | Free (local) |
| Google Gemini | None | GOOGLE_API_KEY |
Free tier |
| Anthropic (Claude) | pip install accesspdf[anthropic] |
ANTHROPIC_API_KEY |
Paid |
| OpenAI (GPT-4) | pip install accesspdf[openai] |
OPENAI_API_KEY |
Paid |
Ollama is the easiest -- no API key, no account, nothing leaves your machine. Just install it and pull a model.
For cloud providers, set your key as an environment variable or pass it directly:
accesspdf generate-alt-text my-document.pdf --provider gemini --api-key AIza...
In the web UI, you can paste your API key in the settings panel -- it's sent per-request and never saved to disk.
Batch processing
Fix every PDF in a folder:
accesspdf batch ./papers/ -o ./papers/accessible/
accesspdf batch ./papers/ -o ./papers/accessible/ -r # include subdirectories
The sidecar file
Image descriptions live in a .alttext.yaml file next to your PDF:
images:
- id: img_37044c
page: 1
ai_draft: 'Bar chart showing quarterly revenue from 2023-2025.'
alt_text: 'Bar chart showing quarterly revenue. Q1 2025 is highest at $4.2M.'
status: approved
Statuses: needs_review (not yet described), approved (gets injected), decorative (screen readers skip it). You can edit this file by hand.
CLI reference
accesspdf check <pdf> # Analyze accessibility (read-only)
accesspdf fix <pdf> -o <output> # Fix structure + inject alt text
accesspdf fix <pdf> --alt-text <yaml> # Fix with sidecar descriptions
accesspdf batch <dir> -o <outdir> # Fix all PDFs in a directory
accesspdf review <pdf> # Terminal UI for alt text
accesspdf serve # Web UI at localhost:8080
accesspdf generate-alt-text <pdf> # AI drafts (Ollama default)
accesspdf providers # Show available AI providers
Installation options
pip install accesspdf # CLI + web UI (everything you need)
pip install "accesspdf[anthropic]" # Add Claude provider
pip install "accesspdf[openai]" # Add GPT-4 provider
Known limitations
- PowerPoint slides saved as PDF don't work well. PowerPoint exports images, text boxes, and shapes as separate unrelated objects with no logical reading order. For slides, add alt text in PowerPoint before exporting to PDF.
- Scanned PDFs (image-only, no selectable text) are detected and flagged but can't be fixed -- they need OCR first.
- AI alt text always needs human review. It's a good starting point but can be wrong or misleading, especially for charts, diagrams, and technical figures.
Contributing
git clone https://github.com/laurenaulet/accesspdf.git
cd accesspdf
pip install -e ".[dev]"
python -m pytest tests/ -v
License
Apache 2.0
Metadata
Release files for accesspdf 1.2.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| accesspdf-1.2.1.tar.gz | 157.9 kB | Without provenance | Details for accesspdf-1.2.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| accesspdf-1.2.1-py3-none-any.whl | Python 3 | none | any | Details for accesspdf-1.2.1-py3-none-any.whl |
Total release size: 240.9 kB
Release files / accesspdf-1.2.1.tar.gz
| Download URL | accesspdf-1.2.1.tar.gz |
|---|---|
| Size | 157.9 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
3f2756b6779d95a2d5e89645d40b2282001b4a744b94994816307428c3048af8
|
|
BLAKE2b-256 checksum How to use checksums |
1715badfa42db8d3b880f09a42c15edef529a688580645b4865c59f0a9a68f02
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Release files / accesspdf-1.2.1-py3-none-any.whl
| Download URL | accesspdf-1.2.1-py3-none-any.whl |
|---|---|
| Size | 82.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
74d62141bf655868479e5884739aa48f33575bd9b9e65e711251300dfd8d567f
|
|
BLAKE2b-256 checksum How to use checksums |
3f744ba8b8686d15a51b66f5319687c3ebfff336a29e3f48d9f3948090279974
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.12.6
|
Security for accesspdf 1.2.1
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.