Skip to main content

borb is a library for reading, creating and manipulating PDF files in python.

Project description

borb logo borb

Code style: black Public Method Documentation: 100% Tests: 1400+ Python Versions: 3.10, 3.11, 3.12 Type Checking: 100% Downloads Monthly Downloads

borb is a powerful and flexible Python library for creating and manipulating PDF files.

📖 Overview

borb provides a pure Python solution for PDF document management, allowing users to read, write, and manipulate PDFs. It models PDF files in a JSON-like structure, using nested lists, dictionaries, and primitives (numbers, strings, booleans, etc.). Created and maintained as a solo project, borb prioritizes common PDF use cases for practical and straightforward usage.

✨ Features

Explore borb’s capabilities in the examples repository for practical, real-world applications, including:

  • PDF Metadata Management (reading, editing)
  • Text and Image Extraction
  • Adding Annotations (notes, links)
  • Content Manipulation (adding text, images, tables, lists)
  • Page Layout Management with PageLayout

…and much more!

🚀 Installation

Install borb directly via pip:

pip install borb

To ensure you have the latest version, consider the following commands:

pip uninstall borb
pip install --no-cache borb

👋 Getting Started: Hello World

Create your first PDF in just a few lines of code with borb:

from pathlib import Path
from borb.pdf import Document, Page, PageLayout, SingleColumnLayout, Paragraph, PDF

# Create an empty Document
d: Document = Document()

# Create an empty Page
p: Page = Page()
d.append_page(p)

# Create a PageLayout
l: PageLayout = SingleColumnLayout(p)

# Add a Paragraph
l.append_layout_element(Paragraph('Hello World!'))

# Write the PDF
PDF.write(what=d, where_to="assets/output.pdf")

🛠 License

borb is dual-licensed under AGPL and a commercial license.

The AGPL (Affero General Public License) is an open-source license, but commercial use cases require a paid license, especially if you intend to:

  • Offer paid PDF services (e.g., PDF generation in cloud applications)
  • Use borb in closed-source projects
  • Distribute borb in any closed-source product

For more information, contact our sales team.

🙏 Acknowledgements

Special thanks to:

  • Aleksander Banasik
  • Benoît Lagae
  • Michael Klink

Your contributions and guidance have been invaluable to borb's development.

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

borb-3.0.8.tar.gz (2.7 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

borb-3.0.8-py3-none-any.whl (3.1 MB view details)

Uploaded Python 3

File details

Details for the file borb-3.0.8.tar.gz.

File metadata

  • Download URL: borb-3.0.8.tar.gz
  • Upload date:
  • Size: 2.7 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for borb-3.0.8.tar.gz
Algorithm Hash digest
SHA256 504daba0a2f06262d83e28b790c5c2b26a73834a2f467cf637467ef2bbf5690b
MD5 b1e1b4bd47fdc1f7154732df66fe3c67
BLAKE2b-256 a6967c33d9d384409777173b4e86087a1095b833b527754f1399e1daa7430a34

See more details on using hashes here.

File details

Details for the file borb-3.0.8-py3-none-any.whl.

File metadata

  • Download URL: borb-3.0.8-py3-none-any.whl
  • Upload date:
  • Size: 3.1 MB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.14.5

File hashes

Hashes for borb-3.0.8-py3-none-any.whl
Algorithm Hash digest
SHA256 69ad7d1a8e28eebb27a1ad531722d1233916b2a4e1e3a1b73076b34b2fbe12b5
MD5 51ee9fe7f811390ed55e91152cf9fa1e
BLAKE2b-256 a92ab805c37a2e1fa30f13bb8baa052150d1da2b071d4fa1b1b9ce86c7f7d924

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page