Skip to main content

ozaru

Read PDF files from Python with a small, simple API and a Rust core.

PyPI version Python versions CI License: MIT

Documentation: https://jair-dev57.github.io/ozaru/

import ozaru

text = ozaru.extract_text("invoice.pdf")
pages = ozaru.page_count("invoice.pdf")

print(f"{pages} pages")
print(text)

Why ozaru?

  • One line per task. Pass a path and get the result. There are no objects to manage.
  • Easy to install. Prebuilt wheels mean you don't need Rust or a compiler.
  • No Python dependencies. ozaru installs nothing else into your environment.
  • Built on Rust. The PDF work is done by pdf_oxide.
  • Typed. Type hints are included, so your editor can autocomplete and check your calls.

Installation

pip install ozaru

Or, with uv:

uv add ozaru

ozaru requires Python 3.10 or newer.

Usage

Extract text

extract_text returns the text of the whole document as a single string:

import ozaru

text = ozaru.extract_text("report.pdf")

Count pages

page_count returns the number of pages as an integer:

import ozaru

pages = ozaru.page_count("report.pdf")

Handle errors

import ozaru

try:
    text = ozaru.extract_text("report.pdf")
except FileNotFoundError:
    print("The file does not exist.")
except ValueError:
    print("The file could not be read as a PDF.")

API

Function Returns Raises
extract_text(path) str FileNotFoundError, ValueError
page_count(path) int FileNotFoundError, ValueError

path can be a str or a pathlib.Path.

Supported platforms

Prebuilt wheels are available for CPython 3.10 and newer:

Operating system Architectures
Linux (glibc) x86_64, aarch64
Linux (musl) x86_64, aarch64
macOS Intel, Apple Silicon
Windows x64

On other platforms, pip builds ozaru from source, which requires a Rust toolchain.

Limitations

ozaru is in early development, so its API may change between releases.

  • It reads the text stored in a PDF and does not perform OCR, so scanned documents may return little or no text.

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.

License

ozaru is released under the MIT License.

Metadata

Release files for ozaru 0.1.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.1.2
File Size Uploaded Provenance Actions
ozaru-0.1.2.tar.gz 78.8 kB Without provenance Details for ozaru-0.1.2.tar.gz

Built distributions (wheels)

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

Total release size: 59.1 MB

Release files / ozaru-0.1.2.tar.gz

Download URL ozaru-0.1.2.tar.gz
Size 78.8 kB
Tags Source
SHA-256 checksum
How to use checksums
40f1c820ef7d6770debbb3c4a80e6f2d4a2d1ff76e6d83b0a4923c039a182469
BLAKE2b-256 checksum
How to use checksums
bd720569dfa9096fbdeee60482d5850d910b6dfaebce64c566d32a02ebb0fbd7
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.6 {"installer":{"name":"uv","version":"0.13.6","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

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

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

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

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

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

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

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

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

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

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

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

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

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

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

Security for ozaru 0.1.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.

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