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, fonts subset, 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.3

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.3
File Size Uploaded Provenance Actions
ozaru-0.14.3.tar.gz 1.4 MB Without provenance Details for ozaru-0.14.3.tar.gz

Built distributions (wheels)

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

Total release size: 20.5 MB

Release files / ozaru-0.14.3.tar.gz

Download URL ozaru-0.14.3.tar.gz
Size 1.4 MB
Tags Source
SHA-256 checksum
How to use checksums
8f213c59d8898e6049f4ea9459e341ad90e73f07183b88a4fde46e7031b55769
BLAKE2b-256 checksum
How to use checksums
4b42878819bf4886de0acb24bafa7dd8dc3409dff96fe217e991338faeebceeb
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.3-cp310-abi3-win_amd64.whl

Download URL ozaru-0.14.3-cp310-abi3-win_amd64.whl
Size 2.5 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
0d25da7c3e01c7d0de53325d96e1106760a7341d3cd20bab27fb6b45b56d59a5
BLAKE2b-256 checksum
How to use checksums
66ac4ba06140c2c01c58d8a7ad15bceccc9df2bdf52f603c7298ea398251630e
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.3-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL ozaru-0.14.3-cp310-abi3-musllinux_1_2_x86_64.whl
Size 3.0 MB
Tags CPython 3.10 Linux musl 1.2+ x86-64 abi3
SHA-256 checksum
How to use checksums
3d5bb79be44c0b9834391000e428fce8b4b610a1c5502b851862510df6c6812b
BLAKE2b-256 checksum
How to use checksums
e46240b1b7f4c3d933f48350268efbb97fdc7d9ea7e469c5a42a7928e4bcef8b
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.3-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL ozaru-0.14.3-cp310-abi3-musllinux_1_2_aarch64.whl
Size 2.9 MB
Tags CPython 3.10 Linux musl 1.2+ ARM64 abi3
SHA-256 checksum
How to use checksums
b6e6fb36032e09a79047c3ffb8f41f24524829ad96dde102fc77ff84c4e829d7
BLAKE2b-256 checksum
How to use checksums
4460b8af35c695b554069810ccaca753dec732d89660e213a108062ea2cd427b
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.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL ozaru-0.14.3-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl
Size 2.7 MB
Tags CPython 3.10 Linux glibc 2.17+ x86-64 abi3
SHA-256 checksum
How to use checksums
cf847662596cb5f2fbc359815a7e03110e6a5b7f208e3de021d0a7132f4f218d
BLAKE2b-256 checksum
How to use checksums
7ed2cdb810427bf608461d7bfff649370db3d4f1bac53d30f37b01b85241821d
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.3-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL ozaru-0.14.3-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl
Size 2.7 MB
Tags CPython 3.10 Linux glibc 2.17+ ARM64 abi3
SHA-256 checksum
How to use checksums
066e00ce05391759f767548e8b52288258b47db8e5d3635bc603907ae0261c18
BLAKE2b-256 checksum
How to use checksums
a5d02928b908f3a30b817212cdb6619e372ed2734b7f9efc77bea28e17cd5cc3
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.3-cp310-abi3-macosx_11_0_arm64.whl

Download URL ozaru-0.14.3-cp310-abi3-macosx_11_0_arm64.whl
Size 2.5 MB
Tags CPython 3.10 abi3 macOS 11.0+ ARM64
SHA-256 checksum
How to use checksums
53e2e0a59494254e2f3590c0262ce8ec07d0b3644bd6531d80f76f927f2c4ef5
BLAKE2b-256 checksum
How to use checksums
cad73d1b12852f4e333205991e51cb01ecdb939c0c60fe8bcd139a4ce5d2bfa4
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.3-cp310-abi3-macosx_10_12_x86_64.whl

Download URL ozaru-0.14.3-cp310-abi3-macosx_10_12_x86_64.whl
Size 2.6 MB
Tags CPython 3.10 abi3 macOS 10.12+ x86-64
SHA-256 checksum
How to use checksums
7ada745a8c0586e4c2cfc7d29f86291453f6953d42e01616d937a7dd4febbeca
BLAKE2b-256 checksum
How to use checksums
ac1b5a64e7ce07a6967aafc80cab2f41969ce5b2d3fc27040de3a4be998a4972
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.3

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.3 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