borb
borb is a library for reading, creating and manipulating PDF files in python.
What it is and what it does
borb is a pure Python library for creating and manipulating PDF documents. It models PDFs using nested lists, dictionaries, and primitives—a JSON-like structure—making it accessible for developers familiar with Python data structures. The library handles reading existing PDFs, writing new ones, and modifying content including text, images, tables, annotations, and page layouts.
The package is maintained as a solo project and prioritizes straightforward, practical PDF workflows. It supports metadata management, text and image extraction, annotation addition, and page layout control through a PageLayout system. With no external runtime dependencies, installation is low-friction, and the library supports Python 3.6 through 3.12.
Use it for:
- Generate PDF reports or invoices programmatically with text, images, and tables
- Extract text and metadata from existing PDF files for processing or analysis
- Add annotations, notes, or links to PDF documents
- Create templated PDF documents with dynamic content insertion
- Manipulate page layouts and structure in existing PDFs
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
borb reads, writes, and manipulates PDF files using a pure Python implementation with a JSON-like document model, supporting content creation, metadata management, and page layout.
Yes, if you need straightforward PDF generation or manipulation in pure Python and can accept the AGPL licensing terms (or purchase a commercial license for proprietary use). The library is actively maintained, has no external dependencies, and covers common PDF workflows. Not suitable if your project is closed-source or commercial without a paid license.
Install
borb on PyPI
pip
pip install borbuv
uv add borbpoetry
poetry add borbInstalling borb
Before you install
Installation is straightforward with no runtime dependencies. The project is actively maintained with a recent release and established community presence (3569 stars).
License in practice
borb is dual-licensed under AGPL-3.0-or-later and a commercial license. AGPL requires source disclosure for networked use; commercial licensing is required for closed-source products, paid PDF services, or proprietary distribution.
Quickstart
from borb.pdf import Document, Page, PageLayout, SingleColumnLayout, Paragraph, PDF
d = Document()
p = Page()
d.append_page(p)
l = SingleColumnLayout(p)
l.append_layout_element(Paragraph('Hello World!'))
PDF.write(what=d, where_to="output.pdf")
Requires Python 3.6 or later; AGPL license restrictions apply to commercial or closed-source use.
Verify before relying
- Whether the AGPL license applies to your use case (cloud services, closed-source projects, or proprietary distribution require commercial licensing)
- Performance characteristics and file size limits for large or complex PDF operations
- Completeness of PDF specification coverage compared to other libraries
Package facts
| License | AGPL-3.0-or-later (agpl) |
| Python support | supports the current Python release (>=3.6) |
| Install friction | low — pure-Python wheel |
| Runtime dependencies | none |
| Maintenance | actively maintained — 11 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 504,690/month — #6,296 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: borb-3.0.9-py3-none-any.whl
Keywords: pdf, pdf-generation, pdf-processing, borb
Tags
More Text Processing packages
A drop-in replacement for Python's standard…
permissive · top 100 on PyPI
pyparsingpyparsing provides a library for building text…
permissive · top 1,000 on PyPI
docutilsDocutils converts plaintext documentation in…
unclear · top 1,000 on PyPI
RapidFuzzRapidFuzz provides fast fuzzy string matching…
permissive · top 1,000 on PyPI
tinycss2tinycss2 parses CSS strings into token and…
permissive · top 1,000 on PyPI
llama-parseLlamaParse parses complex documents (PDFs,…
permissive · top 1,000 on PyPI
PyPDF3PyPDF3 is a pure-Python PDF toolkit for…
permissive · top 15,000 on PyPI
EbookLibEbookLib reads and writes EPUB2/EPUB3 files…
agpl · top 5,000 on PyPI
spire-docSpire.Doc creates, reads, modifies, and…
unclear · top 15,000 on PyPI
PyPDF4PyPDF4 is a pure-Python PDF toolkit for…
permissive · top 15,000 on PyPI
python-libsbmlProvides Python bindings to read, write, and…
copyleft · top 15,000 on PyPI
paddleocrPaddleOCR extracts text, tables, and structured…
permissive · top 5,000 on PyPI
psd-toolspsd-tools reads and writes Adobe Photoshop…
permissive · top 15,000 on PyPI
BabelDOCBabelDOC translates PDF documents between…
agpl · top 15,000 on PyPI
rpaframework-pdfProvides PDF reading and creation capabilities…
permissive · top 15,000 on PyPI
PyPDFFormPyPDFForm creates, inspects, styles, and fills…
permissive · top 15,000 on PyPI