Skip to main content

bolivar

Fast PDF text and table extraction. Written in Rust, drop-in compatible with pdfminer and pdfplumber.

Install

pip install bolivar
implementation("sa.ingenious:bolivar:<version>")
sa.ingenious/bolivar {:mvn/version "<version>"}
[dependencies]
bolivar-core = "<version>"

Extract text

Pull all text from a PDF in one call. The pdfplumber interface opens the file and iterates pages; the pdfminer interface returns the full text directly. JVM and Rust APIs follow the same pattern with their respective conventions.

Path APIs memory-map the source file. Do not change or replace the file until the operation ends and all documents or cursors that use it are released.

import pdfplumber

with pdfplumber.open("doc.pdf") as pdf:
    for page in pdf.pages:
        print(page.extract_text())
from pdfminer.high_level import extract_text

text = extract_text("doc.pdf")
import sa.ingenious.pdf.Document;
import sa.ingenious.pdf.DocumentOptions;

var options = DocumentOptions.builder()
    .maxPages(1)
    .layout(layout -> layout.lineMargin(0.5).wordMargin(0.1))
    .build();

String text = Document.extractText("doc.pdf", options);
import sa.ingenious.pdf.extractText

val text = extractText("doc.pdf") {
    maxPages = 1
    layout {
        lineMargin = 0.5
        wordMargin = 0.1
    }
}
(require '[sa.ingenious.pdf :as pdf])

(def text (pdf/extract-text "doc.pdf"))
use bolivar_core::high_level::extract_text;

fn main() -> bolivar_core::Result<()> {
    let data = std::fs::read("doc.pdf")?;
    let text = extract_text(&data, None)?;
    println!("{text}");
    Ok(())
}

Extract tables

Detect and extract tabular data from each page. JVM table APIs return a closeable, single-pass cursor. Close the cursor to stop work early and release its native state.

Each open cursor has a fixed 50-page window. Those pages include active work and completed results that wait for an earlier page. Several open cursors have separate bounded windows. Close signals cooperative cancellation; active page work stops at its next checkpoint.

import pdfplumber

with pdfplumber.open("doc.pdf") as pdf:
    for page in pdf.pages:
        for table in page.extract_tables():
            print(table)
import sa.ingenious.pdf.Document;
import sa.ingenious.pdf.DocumentOptions;

var options = DocumentOptions.builder().pages(1, 2).build();
try (Document doc = Document.open("doc.pdf", options);
     var tables = doc.tables()) {
    for (var table : tables) {
        System.out.println(table.rowCount() + "x" + table.columnCount());
    }
}
import sa.ingenious.pdf.openDocument

val doc = openDocument("doc.pdf") {
    pages(1, 2)
}
doc.use {
    it.tables().use { tables ->
        for (table in tables) {
            println("${table.rowCount}x${table.columnCount}")
        }
    }
}
(require '[sa.ingenious.pdf :as pdf])

(with-open [doc (pdf/open "doc.pdf" {:pages [1 2]})
            tables (pdf/tables doc)]
  (doseq [table tables]
    (println (:row-count table) "x" (:column-count table))))
use bolivar_core::high_level::{extract_tables_with_document, ExtractOptions};
use bolivar_core::pdfdocument::PDFDocument;
use bolivar_core::table::TableSettings;

fn main() -> bolivar_core::Result<()> {
    let data = std::fs::read("doc.pdf")?;
    let doc = PDFDocument::new(&data, "")?;
    let tables = extract_tables_with_document(
        &doc,
        ExtractOptions::default(),
        &TableSettings::default(),
    )?;
    Ok(())
}

Iterate pages

Walk through pages one at a time to read metadata like page number, dimensions, and a text preview. This is useful when you need to locate content across a large document before extracting specific pages.

import pdfplumber

with pdfplumber.open("doc.pdf") as pdf:
    for page in pdf.pages:
        print(page.page_number, page.width, page.height)
from pdfminer.high_level import extract_pages

for page in extract_pages("doc.pdf"):
    print(page.pageid, page.width, page.height)
import sa.ingenious.pdf.Document;
import sa.ingenious.pdf.DocumentOptions;

var options = DocumentOptions.builder().maxPages(3).build();
try (Document doc = Document.open("doc.pdf", options)) {
    for (var page : doc.extractPageSummaries()) {
        System.out.println(page.pageNumber() + ": " + page.text().substring(0, Math.min(80, page.text().length())));
    }
}
import sa.ingenious.pdf.openDocument

val doc = openDocument("doc.pdf") {
    maxPages = 3
}
doc.use {
    for (page in it.extractPageSummaries()) {
        println("${page.pageNumber}: ${page.text.take(80)}")
    }
}
(require '[sa.ingenious.pdf :as pdf])

(with-open [doc (pdf/open "doc.pdf" {:max-pages 3})]
  (doseq [page (pdf/page-summaries doc)]
    (println (:page-number page) (subs (:text page) 0 (min 80 (count (:text page)))))))
use bolivar_core::high_level::extract_pages;

fn main() -> bolivar_core::Result<()> {
    let data = std::fs::read("doc.pdf")?;
    for page in extract_pages(&data, None)? {
        let page = page?;
        println!("{}", page.pageid);
    }
    Ok(())
}

Async (Python)

Run extraction off the main thread in Python while keeping the same pdfplumber API.

import pdfplumber

async with pdfplumber.open("doc.pdf") as pdf:
    for page in pdf.pages:
        for table in page.extract_tables():
            print(table)

License

MIT

Download files

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

Source Distribution

bolivar-1.9.3.tar.gz (5.4 MB view details)

Uploaded Source

Built Distributions

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

bolivar-1.9.3-cp314-cp314t-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.14tWindows x86-64

bolivar-1.9.3-cp314-cp314t-musllinux_1_2_x86_64.whl (3.5 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

bolivar-1.9.3-cp314-cp314t-musllinux_1_2_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

bolivar-1.9.3-cp314-cp314t-manylinux_2_28_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

bolivar-1.9.3-cp314-cp314t-manylinux_2_28_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

bolivar-1.9.3-cp314-cp314t-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.14tmacOS 11.0+ ARM64

bolivar-1.9.3-cp314-cp314t-macosx_10_12_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.14tmacOS 10.12+ x86-64

bolivar-1.9.3-cp311-abi3-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.11+Windows x86-64

bolivar-1.9.3-cp311-abi3-musllinux_1_2_x86_64.whl (3.6 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ x86-64

bolivar-1.9.3-cp311-abi3-musllinux_1_2_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

bolivar-1.9.3-cp311-abi3-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ x86-64

bolivar-1.9.3-cp311-abi3-manylinux_2_28_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

bolivar-1.9.3-cp311-abi3-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.11+macOS 11.0+ ARM64

bolivar-1.9.3-cp311-abi3-macosx_10_12_x86_64.whl (3.2 MB view details)

Uploaded CPython 3.11+macOS 10.12+ x86-64

File details

Details for the file bolivar-1.9.3.tar.gz.

File metadata

  • Download URL: bolivar-1.9.3.tar.gz
  • Upload date:
  • Size: 5.4 MB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bolivar-1.9.3.tar.gz
Algorithm Hash digest
SHA256 ddfacaaac86df0d47f2f1297f5cca53914c60dfb0785685e57328691bf04fd45
MD5 569ccc8a83d8bb45e47c731204ad11bf
BLAKE2b-256 2597c7566b9cc10a73bb048f6c643ac6fba23075ff276a7aee2d1ae42e0c407a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3.tar.gz:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: bolivar-1.9.3-cp314-cp314t-win_amd64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.14t, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bolivar-1.9.3-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 493fca3b2369a58b76694afba1ab13909eae8b4e8c8f8eecc8ef35de65cc7829
MD5 90f88a3a134b385750ebc060f643359c
BLAKE2b-256 f56fd086c3408abef9b8dee5db910fa521adf800fa66b6d6dde026f040231cb0

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp314-cp314t-win_amd64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 0c13718b772ca97a8637d922a3182b5e15e59a683887d769c717ec8f9d5a0ccc
MD5 b67d3d85e9b862cb8217cc6173c1b432
BLAKE2b-256 6d1609844f5a3c5244e6b2f43944d68146f6c0c375117d6bf6f9c218b4f53f73

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp314-cp314t-musllinux_1_2_x86_64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp314-cp314t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 e67260887edca2225d2cd7075838044dd9fc77094c8ce68f6e8f60abffffe3f2
MD5 1d7c3a764b6a974bdf91c1dd3da54dff
BLAKE2b-256 3d40b69aa80854051e775fd9f48abddafb0506af59d2fd54467bd7f8a873ea3c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp314-cp314t-musllinux_1_2_aarch64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 97cad59c2c333c2f7368744b41394beb04ce1ec206e61cf16481730f4ddb286b
MD5 3955c2e764d62efc2bd9920890fe2ea7
BLAKE2b-256 cda2c9ed55c1d0d8049db3343bcbebb9f7258bed4de4f6e33c71a66862994e64

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp314-cp314t-manylinux_2_28_x86_64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 48013f4b21134262a6f87b8a9af8a1476a2a663a0a0f951a8a2258b66e592667
MD5 38accc04022dd7fa404b22c405bab4f5
BLAKE2b-256 f5e9d5a8753a908562d3344a8e6365218402a9a6578b85cf44726d8e2b74be5f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp314-cp314t-manylinux_2_28_aarch64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c9d69c0d1b3b0adf63a1f8fd306310e194042510dec7d97b3d3057680e263a40
MD5 63a51a5a96f59ac3c26a595b473f83ae
BLAKE2b-256 e99584a0ab38119e896607552658807bc52d2e1a593247ce43578fe9f02bb48f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp314-cp314t-macosx_11_0_arm64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp314-cp314t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a1ed725c601235bc567d746a350c272f185d1ec4fc626648d1005a6958c8532d
MD5 3017956521180bcee6eeaac45f17eb1e
BLAKE2b-256 944b9a8356f068e90c427fc553d79cc8888fc7d452ef429f3340304c2ac1bcdd

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp314-cp314t-macosx_10_12_x86_64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: bolivar-1.9.3-cp311-abi3-win_amd64.whl
  • Upload date:
  • Size: 3.0 MB
  • Tags: CPython 3.11+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/7.0.0 CPython/3.13.14

File hashes

Hashes for bolivar-1.9.3-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 da2a608fcfd25307d3c9751dc1023061e4d5362328db47044bd47b1302cdd3c6
MD5 9a5f8046c88311b8d0d2069b986e4b0d
BLAKE2b-256 6a267fe6cb0263bdddcd83b7191d59afe3c86e2ad34c5fa7059f2e2f66820148

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp311-abi3-win_amd64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 262ccf6d7400fd42f9fbbb7e66a2ae1ad67df8e6601a3c6973613504787d3652
MD5 cbffc896c5d856e363cd2c02fb01e45c
BLAKE2b-256 28ec96b2634fb97bf18b4972c93500f9ff61fccae6b8795b79e4d8b37e2c74fa

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp311-abi3-musllinux_1_2_x86_64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 410b2dda589fcf91660fbb8b6b15f94665cf53cb19990cc5452f87ee834bfe6b
MD5 6d1fbb71baa0b638c3b2252ba843313f
BLAKE2b-256 2a849aa38be0ec6dc00ade370ed0c6c958de89fea209acb2a0b39d1ba93c7eec

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp311-abi3-musllinux_1_2_aarch64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 9c67aa63fba2461cab6391dc6cbf801350b2469400422171216d6be2c563d6c6
MD5 b011b69ac999a3f52fedb335e3821971
BLAKE2b-256 7f27915d38cf223935592afe8c577594f63f3d9f6b685321ae6f41ab25a24ec7

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp311-abi3-manylinux_2_28_x86_64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 607023015741d512939ff942171bf142f4c7b08f610154b560b7108d9941009b
MD5 06795b6faa076dcf4fce68a5be416e24
BLAKE2b-256 f2cdfc3d0e4cac731fc8260fa70e01d8a18ad832c74f6d136f202331b6f59492

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp311-abi3-manylinux_2_28_aarch64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 82bb6d3d34c8ebe0000f105ff2721724d157493517e2c365315b20031719da4f
MD5 473a5abb59a227057c78312385c5dac2
BLAKE2b-256 ab75435baf843d05fe64bc93bf69b2d405e078d0345f8df630697d22d4cb247f

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp311-abi3-macosx_11_0_arm64.whl:

Publisher: release.yml on harubi/bolivar

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

File details

Details for the file bolivar-1.9.3-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-1.9.3-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6ba6e160f14467721141850c04f1ecacb4ce276fb7ab5c0b848330f41debc025
MD5 c7f5977c8e1092e43efea1f9db5a5e97
BLAKE2b-256 fe17ae5b6ca70f74c15fd8f4e33b064838beb05566286d615b4386dee00ff9c3

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-1.9.3-cp311-abi3-macosx_10_12_x86_64.whl:

Publisher: release.yml on harubi/bolivar

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

Release history Release notifications | RSS feed

2.2.1

15 files

2.2.0

15 files

2.1.0

15 files

2.0.0

15 files

This release

1.9.3 This release

15 files

1.9.2

15 files

1.9.1

15 files

1.8.0

43 files

1.7.0

45 files

1.6.1

45 files

1.6.0

45 files

1.5.2

45 files

1.5.1

95 files

1.5.0

95 files

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