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

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.1
File Size Uploaded Provenance Actions
ozaru-0.1.1.tar.gz 77.9 kB Without provenance Details for ozaru-0.1.1.tar.gz

Built distributions (wheels)

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

Total release size: 59.0 MB

Release files / ozaru-0.1.1.tar.gz

Download URL ozaru-0.1.1.tar.gz
Size 77.9 kB
Tags Source
SHA-256 checksum
How to use checksums
05c7c6d4224f0b0da58f6dd0fff4ee47e44d25695cd6687d23a881bfee3fc1c5
BLAKE2b-256 checksum
How to use checksums
b803defdf0a85af165a9988dbc493715d93632565cb23bf018c807fae8d576e8
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.1-cp310-abi3-win_amd64.whl

Download URL ozaru-0.1.1-cp310-abi3-win_amd64.whl
Size 7.9 MB
Tags CPython 3.10 Windows x86-64 abi3
SHA-256 checksum
How to use checksums
d2b0787aacb812799c398eff04f11e1d675828da8c783bf56e4250cf2c6042b0
BLAKE2b-256 checksum
How to use checksums
aaab2d5e4b7bc813e95c2533ec35b16bde4e7bf6da43228d85e0aa62b2a5b619
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.1-cp310-abi3-musllinux_1_2_x86_64.whl

Download URL ozaru-0.1.1-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
65b26ba9fc1f9d9f9c07e78dcc0c9f74017f6865f99a24264baa81bed956e87e
BLAKE2b-256 checksum
How to use checksums
fa1b3e769a6b529b8dab62aba75477072e1a7b7a3a3ce5a7d8f898cc9054cc31
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.1-cp310-abi3-musllinux_1_2_aarch64.whl

Download URL ozaru-0.1.1-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
2e889111a2c092c8380b1e02bfd31f2e6c96d2a65bf80bd789f2a2515b0a3e99
BLAKE2b-256 checksum
How to use checksums
b774aeafe00aa8a1f1886fe0cfa153f656ba60074038a1918cfc2bc09bf152a3
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.1-cp310-abi3-manylinux2014_x86_64.manylinux_2_17_x86_64.whl

Download URL ozaru-0.1.1-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
e21b6ec93c757d6dbaf6bb83f7b4a33ba9085bbd29be04ee426c9b6c8e3d3c06
BLAKE2b-256 checksum
How to use checksums
2628fe9524aea1c2d6973664e95da681b77aaa28e8465703bce017e9facc20c8
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.1-cp310-abi3-manylinux2014_aarch64.manylinux_2_17_aarch64.whl

Download URL ozaru-0.1.1-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
4d9b91053ff0156c873dea10bec2bf53422ec07ce5a7855af264a29f0bc24dc3
BLAKE2b-256 checksum
How to use checksums
7352cb43db6731f3643f37c6399ff31b27b49f3a3b3782c93ae98fc28ab9f5f8
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.1-cp310-abi3-macosx_11_0_arm64.whl

Download URL ozaru-0.1.1-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
b7b81417a7737490a31a96c3c2c55ab4a91f0e610af863af14d0ad9574981e0b
BLAKE2b-256 checksum
How to use checksums
9750c2e9a2347ad58f937de416b1fa34969f46945517e9312c7ea54ffa15ad05
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.1-cp310-abi3-macosx_10_12_x86_64.whl

Download URL ozaru-0.1.1-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
3ea1248524e102f2002d74a5a319329b988e1fa68e1fee7c8bb620cf994af3b2
BLAKE2b-256 checksum
How to use checksums
f7c7d0ae02747f244416d09cb0f1aa3d0dcb36bb2cc0153633210be06f794432
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.1

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