Skip to main content

Native Python helpers for MinerU Rust

Project description

MinerU Rust

Rust client library, command-line tools, and local API server for parsing PDF, image, and Office documents with an external OpenAI-compatible MinerU VLM service. PDF rendering uses pure Rust; no model is downloaded or run locally.

Compatibility is pinned to the MinerU 3.4.4 vlm-http-client transport baseline. See the compatibility contract and usage guide. This is not a full MinerU compatibility claim.

Requires Rust 1.89 or newer.

Rust library

cargo add mineru
use mineru::{ClientConfig, MinerUClient, ParseOptions, PdfInput};

#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
    let client = MinerUClient::new(ClientConfig::new(
        "https://example.test/v1",
        "model-id",
    )?)?;
    let document = client
        .parse_pdf(PdfInput::Path("input.pdf".into()), ParseOptions::default())
        .await?;
    println!("{} pages", document.pages.len());
    Ok(())
}

CLI and API server

cargo install mineru
mineru --help

The package installs the existing mineru, mineru-api, mineru-vlm, mineru-vlm-api, and mineru-office-convert binaries. See docs/usage.md for service configuration and complete options.

Python

Wheels support CPython 3.9 and newer:

pip install mineru-rs
import mineru_rs

print(mineru_rs.canonical_stem("a bad/pdf"))
mineru_rs.validate_pdf_options(0, None, True, True, True)

Python currently exposes only canonical stem handling and PDF-option validation. It does not expose asynchronous document parsing. Releases are wheels only; there is no sdist or source fallback for unsupported platforms or PyPy.

Node.js

npm install @alexsun-top/mineru
const mineru = require('@alexsun-top/mineru')

console.log(mineru.canonicalStem('a bad/pdf'))
mineru.validatePdfOptions(0, null, true, true, true)

Node.js currently exposes only canonical stem handling and PDF-option validation. It does not expose asynchronous document parsing. Node.js 18 or newer is required.

License

Licensed under either Apache-2.0 or MIT, at your option.

Project details


Download files

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

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

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

mineru_rs-0.1.1-cp39-abi3-win_amd64.whl (403.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

mineru_rs-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (329.5 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ x86-64

mineru_rs-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (329.0 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

mineru_rs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl (315.6 kB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

mineru_rs-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl (335.0 kB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file mineru_rs-0.1.1-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: mineru_rs-0.1.1-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 403.9 kB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.13

File hashes

Hashes for mineru_rs-0.1.1-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 1d98f21419fee926feb9318915bc3d71014718333ee51e7247f61486d434e954
MD5 ca82118a8f24fcf4b9993bac9c7d5fb7
BLAKE2b-256 15ee5139418f72b7d7a2f2a679edae29fde84fee1884ee323342c2fcdf06894d

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.1-cp39-abi3-win_amd64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mineru_rs-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 e4073cd5dddf21e897e6dbec01c7ad4fbd792d1614eca66955e4f8ee16d0c3ca
MD5 ab1572dfd0fe03008d2e546c39cb5dd7
BLAKE2b-256 905ba6d84ae1d5b14651e56b0288157c9368380bc39d52f6a791cfcd34e8fd96

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.1-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mineru_rs-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 051e467514d331c342cec5280b8924c2df0d1106a4c88e24c2ac9f5fcd2bce45
MD5 974b6f1f21876906b97b85c4c4adb00e
BLAKE2b-256 eb528690670a2baf80eae81a067a8b0635e8af22311fc0759e3636f356f7c0fc

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.1-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mineru_rs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 773dc8c8a3f3bd11e857fad744eebe2ea1ac75e7fbe04cbe34ef9f4e9a2808e7
MD5 dc740a7b59765b942dda1bc5f89fee24
BLAKE2b-256 1de1f1c0c4fe508f81b440a4afeb3fb6eb464c96cfab3c163c5567b5db6bfba3

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.1-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file mineru_rs-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 9c9e1bdc7ae2fc148067a249fb38a09023b48779a473ff1b6b6cfcc5af596892
MD5 656be10a92aa4480916a5eeff275123b
BLAKE2b-256 950ad84c67fa71496355721477bd43556dbb62ed96e6242adff6986797f4ffc6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.1-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on agentsyaml/mineru-rs

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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