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);
     var pages = doc.pageSummaries()) {
    for (var page : pages) {
        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 {
    it.pageSummaries().use { pages ->
        for (page in pages) {
            println("${page.pageNumber}: ${page.text.take(80)}")
        }
    }
}
(require '[sa.ingenious.pdf :as pdf])

(with-open [doc (pdf/open "doc.pdf" {:max-pages 3})
            pages (pdf/page-summaries doc)]
  (doseq [page pages]
    (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-2.2.1.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-2.2.1-cp314-cp314t-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.14tWindows x86-64

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

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

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

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

bolivar-2.2.1-cp314-cp314t-manylinux_2_28_x86_64.whl (3.4 MB view details)

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.14tmacOS 11.0+ ARM64

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

Uploaded CPython 3.14tmacOS 10.12+ x86-64

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

Uploaded CPython 3.11+Windows x86-64

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

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

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

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

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

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

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

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11+macOS 11.0+ ARM64

bolivar-2.2.1-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-2.2.1.tar.gz.

File metadata

  • Download URL: bolivar-2.2.1.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-2.2.1.tar.gz
Algorithm Hash digest
SHA256 5356c40f9dcea76b4838a1ce0f115ccf050b9aba165d9a0dfddb8aa5ac8ce60d
MD5 2941167a756f0a4c3f0c12c70695125b
BLAKE2b-256 e77a8f8ca972ab8ef114c7ce1c057b67a41547e45edfeebaaac641ddb4873109

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1.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-2.2.1-cp314-cp314t-win_amd64.whl.

File metadata

  • Download URL: bolivar-2.2.1-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-2.2.1-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 3259b9593997700a09bbad2228af098e3de33d5adcac0876ef293a790dc4ae7a
MD5 d966a84174cad4b94d73e7caae143b5b
BLAKE2b-256 d2d382c17c742fc7fc6b066b663d513b2ec3554f4868bcceaf6862007bd499ca

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 f37fd5268729d5c70917d99beed87551436fff23e20d07ccfb60adcb2957ddec
MD5 74b407f7bb36b971f869c43b83fd36a3
BLAKE2b-256 ba0794d8330bb0e5e8f6a470f962859925d9664e028b8bfbb53bad5e7d6c0ea6

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 2a0588ff1b86abd2a59a0d55356b9a0325fb72c60cd134d9fd546c4a6ca63bb5
MD5 b0942d45f6d5758b4c6354b1aefdaa28
BLAKE2b-256 816c9a050b105bfe379436a61907a94b0e4dcf57ddbf582d079d5d62e225de32

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp314-cp314t-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 79456e26beb3ab35781d8279bc614c67f146d1054068ab9a447c2175471bf93d
MD5 6c22978e80253b2421a02ae501e10bd2
BLAKE2b-256 3a5dc5669eeecbcc66a018889ab6e2d2dd26b677532d1cd78dd8cebaa5a690ae

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp314-cp314t-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 014ba611057eb92e5b1ff7a710a5291f1c5c445b5ba337b0158b8fa9e6a0eb3b
MD5 2a7df38219c87805bcf3abf477279e59
BLAKE2b-256 936693c292e54dfbab096f38503bd79c550fad98559088f6c84de45c0a442648

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp314-cp314t-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 fec308ea9a69e6d45dc5518d4a12fdd6bd2ada4bdde17f365efd6389b75fed77
MD5 5c4417f2db1fbf566aedbd29c5eed635
BLAKE2b-256 ea3d9c413844af5a950574cfcc17e521456ac4359395fe61a36b40dd1b1da38a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp314-cp314t-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 6d3e906845614cb544609c796d2ebe78161b24e966a084a822fbd584af029fb6
MD5 066b4d9e4f311731eb7bb407082fe2a6
BLAKE2b-256 6b24c9b7619d27ac4505a3d78f4e7c23a14a416abe4a20aef092f4c91abd92c5

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp311-abi3-win_amd64.whl.

File metadata

  • Download URL: bolivar-2.2.1-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-2.2.1-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 513c792b4456a639e8b5cacd41a88377fdfe105d656b6faa19013bcdab01dae3
MD5 65f173ad545e02c69532fa1cd11b708f
BLAKE2b-256 b504e6eb7f170322226eb810ae58f580c97af56c64ed4bc436e18d7da4501a6a

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp311-abi3-musllinux_1_2_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 7e724941816224d38f9ab1e2e20c953d5f54375596e13e670f6999f833017258
MD5 eb21bb4ece2f2120ed05f2cc34adcf99
BLAKE2b-256 639e342950310da75bf26d1a3a019b3f11e4040d52427a272d15391164d5c9d6

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp311-abi3-musllinux_1_2_aarch64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 d5917c4d66178acd27a8f6cd47e6fb811bd5736373ff636434539a6aa579c832
MD5 94e1d208fb4041307b0aa288e5b0afed
BLAKE2b-256 abbcf8b584d349c86550bd9c3239810dffcc816fbb5f0a9b49d92887c0573a6c

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp311-abi3-manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 e83924b80fbba3910d5d85942d33f0a7768bf247191545e87e34bb92a53413ca
MD5 394fbf044fcd4d18692b4d720b1f8c57
BLAKE2b-256 e60ce39f3f442d5b60093071178be418850eadb9332d4cec5089ed85637f2db9

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp311-abi3-manylinux_2_28_aarch64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 7a78394e522aa45e35fb769eb3941c76b5b4103e3a9506a1797293228eff6f81
MD5 62d247a901492f298435aef6828e29de
BLAKE2b-256 1be15945af03412f3f5c2bc93b7668b3837987c19afabee0596fdf4237357a50

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp311-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d63519e4ebbc7f8b74cef532bc4319ad8a5cd9d807e4cddbfc93b74d5beab45d
MD5 c04d67a7afef4877d6513fab019a4e3c
BLAKE2b-256 13630333c1a8568fcf295dbd561c43385bd94789059277f0f0d659ce1cc473cf

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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-2.2.1-cp311-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for bolivar-2.2.1-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 d25fe49961dd83fc27a056d70ca7b0cd68efe663a09048250289d5be8fbc9f5c
MD5 6686471671f62cefbd2ef6cf02043198
BLAKE2b-256 badbfacab84ef5be675c3c93217a99a299235ace705543d686721b5e5bd68087

See more details on using hashes here.

Provenance

The following attestation bundles were made for bolivar-2.2.1-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

This release

2.2.1 This release

15 files

2.2.0

15 files

2.1.0

15 files

2.0.0

15 files

1.9.3

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