Skip to main content

   Ozaru

Read, analyze, draw, convert, edit and protect PDF files from Python.
Small API, Rust core, no dependencies.

PyPI Python CI License: MIT

Documentation · PyPI · Changelog


Time to extract text and draw pages: ozaru against PyMuPDF and pypdf, shorter is better

Median time of one call, on an Intel Core i5-11400H. All the numbers.

import ozaru

# The text, in reading order, and the tables as rows or Markdown
text = ozaru.extract_text("invoice.pdf")
tables = ozaru.extract_tables("report.pdf")

# Every page as a picture, on every core; pictures into a PDF
ozaru.render_pages("catalog.pdf", "pages", format="jpeg")
ozaru.images_to_pdf(["scan.tif", "photo.jpg"], "out.pdf")

# A text taken out of the file for good, not just covered
ozaru.redact_text("contract.pdf", "safe.pdf", "ID 1234567")

# What changed between two versions
print(ozaru.compare("v1.pdf", "v2.pdf").summary())

What it does

  • Read the text in reading order, words and lines with their boxes, fonts and colors, and search with positions.
  • Analyze tables, headings, regions, and the whole document as Markdown for language models.
  • Convert pages to PNG, JPEG, BMP, PNM or TIFF, and pictures (JPEG, PNG, BMP, GIF, TIFF, JPEG 2000) to PDF.
  • Organize pages: merge, split, insert, replace, move, rotate, crop and delete.
  • Edit with text, shapes, pictures, watermarks, highlights, notes and links; fill, create and flatten forms.
  • Protect with real redaction, sanitizing and passwords; compare two versions of a PDF.
  • Shrink a PDF without loss: compressed object streams, streams compressed again, duplicates kept once, page content cleaned, pictures written smaller; and, if asked, pictures with fewer pixels or as JPEG.

Every function has a command too: uvx ozaru markdown report.pdf, uvx ozaru compare v1.pdf v2.pdf, and more.

ozaru PyMuPDF pypdf
License MIT AGPL or paid BSD
Engine Rust, no dependencies, fuzzed in CI C (MuPDF) pure Python
Draws pages yes yes no
Images own readers and writers MuPDF's needs Pillow
Compare PDFs built in no no

Young and moving fast: the road to 1.0.0 is to do everything PyMuPDF and pypdf do, and more.

Installation

With uv, in your project:

uv add ozaru

From the terminal, with nothing installed:

uvx ozaru text invoice.pdf

Or into the active environment: uv pip install ozaru. It also installs with pip. Python 3.10 or newer; wheels for Linux, macOS and Windows, so no Rust needed.

Contributing

You need Rust and uv. Then run:

git clone https://github.com/Jair-dev57/ozaru.git
cd ozaru
uv run pytest

See the contributing guide. Bug reports and ideas are welcome in the issue tracker; for security problems, read SECURITY.md.

License

ozaru is released under the MIT License.

Metadata

Release files for ozaru 0.14.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ozaru 0.14.2
File Size Uploaded Provenance Actions
ozaru-0.14.2.tar.gz 1.4 MB Without provenance Details for ozaru-0.14.2.tar.gz

Built distributions (wheels)

Table of built distributions (wheels) for ozaru 0.14.2
File Actions
ozaru-0.14.2-cp310-abi3-win_amd64.whl CPython 3.10 abi3 Windows x86-64 Details for ozaru-0.14.2-cp310-abi3-win_amd64.whl
ozaru-0.14.2-cp310-abi3-musllinux_1_2_x86_64.whl CPython 3.10 abi3 Linux musl 1.2+ x86-64 Details for ozaru-0.14.2-cp310-abi3-musllinux_1_2_x86_64.whl
ozaru-0.14.2-cp310-abi3-musllinux_1_2_aarch64.whl CPython 3.10 abi3 Linux musl 1.2+ ARM64 Details for ozaru-0.14.2-cp310-abi3-musllinux_1_2_aarch64.whl
ozaru-0.14.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl CPython 3.10 abi3 Linux glibc 2.17+ x86-64 Details for ozaru-0.14.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
ozaru-0.14.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl CPython 3.10 abi3 Linux glibc 2.17+ ARM64 Details for ozaru-0.14.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
ozaru-0.14.2-cp310-abi3-macosx_11_0_arm64.whl CPython 3.10 abi3 macOS 11.0+ ARM64 Details for ozaru-0.14.2-cp310-abi3-macosx_11_0_arm64.whl
ozaru-0.14.2-cp310-abi3-macosx_10_12_x86_64.whl CPython 3.10 abi3 macOS 10.12+ x86-64 Details for ozaru-0.14.2-cp310-abi3-macosx_10_12_x86_64.whl

Total release size: 19.7 MB

Release files / ozaru-0.14.2.tar.gz

Download URL ozaru-0.14.2.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
bf5e8566025430ff7aaac1ed82e3d4cef1536ffa04c665ee18f1c3eda2ec46a5
BLAKE2b-256 checksum
How to use checksums
6772fa13b0aee5e3f76e01b9b7254b629bf3993dc2fc20674146ae9a891f2f84
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ozaru-0.14.2-cp310-abi3-win_amd64.whl

Download URL ozaru-0.14.2-cp310-abi3-win_amd64.whl
Size 2.4 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
3fc7f01d08325d273455ee99742832086490856bc5b1c9c7cb5b7a0142694f3e
BLAKE2b-256 checksum
How to use checksums
ddcfc980ccaa3d63d8e3df1dc553ead1d79da283716cec06550183fae399ccf2
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ozaru-0.14.2-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL ozaru-0.14.2-cp310-abi3-musllinux_1_2_x86_64.whl
Size 2.9 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
9e50000b983eca549b269174f4d37fa78a7db60e45da113507b2e348172f35c6
BLAKE2b-256 checksum
How to use checksums
9fe3ec5d8046c7ba2453302dd461cc0e1974adae80808cdf4f19f017a4940188
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ozaru-0.14.2-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL ozaru-0.14.2-cp310-abi3-musllinux_1_2_aarch64.whl
Size 2.8 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
ab4bbad91aa4071033eb51eb74fd1dc50c1d01c73efb907642672750c1f7058f
BLAKE2b-256 checksum
How to use checksums
36d89ccfab4b94a09c2bb8e1470626d761a2ad9dc665b58efac021bbe53efc81
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ozaru-0.14.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL ozaru-0.14.2-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
8ac7b6fab1f982a573d8d80b7381c4b9f7be157e012c1af8af2cf3a1c05ba746
BLAKE2b-256 checksum
How to use checksums
fc4cd661d7d67a32288a1f10ba4bb020bbad58bd299b8106c7b96b51186af2c5
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ozaru-0.14.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL ozaru-0.14.2-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.6 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
384109c40176dbcf1acd999b9103e21c775512695ffacb3e4d25d9c92f6e36ec
BLAKE2b-256 checksum
How to use checksums
34062f6a2886f4a08c6dd78229d1a1871b6fcb728d0f8a9b48a28ce76069ac7c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ozaru-0.14.2-cp310-abi3-macosx_11_0_arm64.whl

Download URL ozaru-0.14.2-cp310-abi3-macosx_11_0_arm64.whl
Size 2.4 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
0a1d58904742c2a24509ab507d2e699bcff68a830f35bf81b256a50418e1a299
BLAKE2b-256 checksum
How to use checksums
21dceb3354b053de6f3495294e4b9a44aabdcf484b23e943fd36d02aad8a6a3c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Release files / ozaru-0.14.2-cp310-abi3-macosx_10_12_x86_64.whl

Download URL ozaru-0.14.2-cp310-abi3-macosx_10_12_x86_64.whl
Size 2.5 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
b5dc9ec14568d6259f62971a87a22de6d135f2a1e89b8efe30b4a34233d09d08
BLAKE2b-256 checksum
How to use checksums
a4281782ad32d4ae251f491bfc588363efdf407d6b69a6d99d9d855af5a7028f
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.12 {"installer":{"name":"uv","version":"0.13.12","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"26.04","id":"resolute","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

Security for ozaru 0.14.2

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.

Release history Release notifications | RSS feed

This release

0.14.2 This release

8 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page