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.0-cp39-abi3-win_amd64.whl (403.9 kB view details)

Uploaded CPython 3.9+Windows x86-64

mineru_rs-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (329.0 kB view details)

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

mineru_rs-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl (329.1 kB view details)

Uploaded CPython 3.9+manylinux: glibc 2.17+ ARM64

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

Uploaded CPython 3.9+macOS 11.0+ ARM64

mineru_rs-0.1.0-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.0-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: mineru_rs-0.1.0-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.0-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 729168dd9ed481b30f559a222cd6933e0563af4e2edd88cd98de9afed3f05e1d
MD5 a37d3f7006d641856ad20d6be16a6619
BLAKE2b-256 6f2e34cb883fdc2c7853b5f079b6d3a1767a45a2c2083fecf739e498ce904508

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.0-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.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.1.0-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 5a1049ab901703919330fc7a53c2b8e071ab60368bd5fafea28b7679d2878040
MD5 f332e2164abca6c74758469f6f192364
BLAKE2b-256 89b142840d8f19f695baaec736b93de4f69cfc90fff86b447d30b85807f1393c

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.0-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.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.1.0-cp39-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 0eb341a7c34d7022ef530b3e1d8939ada997811a3f37d3eaeeaf19913f1cf66b
MD5 21caf6efebb794a64ddf7adaed75822a
BLAKE2b-256 2756422393a44d58d9aabfe5c9edda40cc547a8dda1c8f4625139ef2c36559a6

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.0-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.0-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.1.0-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 1b85a32a800261e7a02c641262ef45e68ad0e676d343b64a5b066b968be69f90
MD5 bb155650646ece50c6bc2e5671b70ab6
BLAKE2b-256 52d204ee42bf72aa2b1c621ac23cdb2d455a77b4e01ba9287081f7ab978e5e38

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.0-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.0-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for mineru_rs-0.1.0-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 c8d89c889c89aa5f3d389e3b4a37b4e524b7bcbaa752a3bba1ebc1bb20dcea72
MD5 a5a2ae504ebea6f8b001bcdff25924ed
BLAKE2b-256 bc3d00298c91c0f3faa85b6db30a3c1b8cbd5cbb449a614577f17c26e1370397

See more details on using hashes here.

Provenance

The following attestation bundles were made for mineru_rs-0.1.0-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