Registry / serialization / borb
library3.0.9pypypi✓ verified 22d ago

borb is a comprehensive Python library designed for reading, creating, and manipulating PDF files. It offers a wide range of functionalities from simple text and image handling to advanced layout management. The library is actively maintained with frequent patch releases, typically on a monthly or bi-monthly cadence, adding new features and improving robustness.

pip install borb
INSTALL
IMPORT
SIG · BORB
B
borb
serializationpythonv3.0.9
Install
9.9s avg
Import
1035ms
Disk
31MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v3.0.9 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.915 runs
installs and imports cleanly · install 0.0s · import 0.753s · 34.1MB
glibc
py 3.103.915 runs
installs and imports cleanly · install 9.9s · import 0.902s · 35MB
31MB installed
● package 31MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

Document
from borb.pdf.document import Document
from borb.pdf.document.document import Document

This quickstart demonstrates how to create a simple PDF document containing 'Hello World!' text using borb. It initializes a Document, adds a Page, places a Paragraph using a bounding box, and saves the document to a file.

from borb.pdf.document.document import Document from borb.pdf.page.page import Page from borb.pdf.canvas.layout.text.paragraph import Paragraph from borb.pdf.pdf import PDF from borb.pdf.canvas.geometry.rectangle import Rectangle import os def create_hello_world_pdf(): # Create a new Document pdf = Document() # Add a Page page = Page() pdf.add_page(page) # Add a Paragraph with 'Hello World!' page.add_layout_element( Paragraph( "Hello World! This is a borb generated PDF.", bounding_box=Rectangle(50, 700, 500, 50) ) ) # Define output path output_path = os.environ.get('BORB_OUTPUT_PATH', 'hello_borb.pdf') # Store the PDF to a file with open(output_path, "wb") as pdf_file_handle: PDF.add_document_to_file(pdf, pdf_file_handle) print(f"PDF saved to {output_path}") if __name__ == "__main__": create_hello_world_pdf()
borb --version
Debug
Known issues
breakingMajor architectural changes in borb v3.0.0/v3.0.1, including the removal of the `Decimal` type for numeric operations and the integration of `Annotation` objects into the `LayoutElement` framework. Code written for borb v2.x will likely require significant modification.
fix
Review the borb v3.x documentation and examples, particularly regarding numeric handling and the new `LayoutElement` paradigm for annotations and other page content.
affects: >=3.0.0
gotchaStarting with v3.0.7, many advanced features (e.g., image processing, advanced text layout, generative AI integrations) are moved to optional 'extras'. A simple `pip install borb` will only install the core library. To access full functionality, you must install with `borb[full]` or specific feature groups like `borb[image,text]`.
fix
Install borb with the `[full]` extra (`pip install borb[full]`) or specify the required feature groups (e.g., `pip install borb[image,text]`) to ensure all necessary dependencies are met for your use case.
affects: >=3.0.7
gotchaVersions prior to v3.0.1 had packaging issues due to the inclusion of non-Python files, which could cause problems when attempting to package or deploy `borb` in certain environments.
fix
Upgrade to borb v3.0.1 or newer. If forced to use an older version, consult borb's GitHub issues for potential workarounds for packaging non-Python assets.
affects: <3.0.1
Upgrade
Version history
3.0.9latest on PyPI · released Aug 3, 2026
Audit
Dependencies
PillowoptionalRequired for image processing features, included with `[image]` or `[full]` extras.
shapelyoptionalUsed for geometric operations, often part of text or layout processing, included with `[text]` or `[full]` extras.
transformersoptionalFor generative AI features, included with `[genai]` or `[full]` extras.
Agent activity
15 hits · last 30 days
node
12
Amazon
1
OpenAI (training)
1
Resources
borb — pip install borb · libregistry