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.1.0.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.1.0-cp314-cp314t-win_amd64.whl (3.0 MB view details)

Uploaded CPython 3.14tWindows x86-64

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

Uploaded CPython 3.14tmusllinux: musl 1.2+ x86-64

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

Uploaded CPython 3.14tmusllinux: musl 1.2+ ARM64

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

Uploaded CPython 3.14tmanylinux: glibc 2.28+ x86-64

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

Uploaded CPython 3.14tmanylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.14tmacOS 11.0+ ARM64

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

Uploaded CPython 3.14tmacOS 10.12+ x86-64

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

Uploaded CPython 3.11+Windows x86-64

bolivar-2.1.0-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.1.0-cp311-abi3-musllinux_1_2_aarch64.whl (3.4 MB view details)

Uploaded CPython 3.11+musllinux: musl 1.2+ ARM64

bolivar-2.1.0-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.1.0-cp311-abi3-manylinux_2_28_aarch64.whl (3.3 MB view details)

Uploaded CPython 3.11+manylinux: glibc 2.28+ ARM64

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

Uploaded CPython 3.11+macOS 11.0+ ARM64

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

File metadata

  • Download URL: bolivar-2.1.0.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.1.0.tar.gz
Algorithm Hash digest
SHA256 34ef4f4c6c698387fb6d95f4cdb1d5bbce9a38a702c8df5e82c33326a7d2eafe
MD5 40b3c390d534273e0e5ee85769032241
BLAKE2b-256 4d49a71d9f1adef735e2f96399cbb7c34f99bde98641f4e0dd49ba96fa08617c

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bolivar-2.1.0-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.1.0-cp314-cp314t-win_amd64.whl
Algorithm Hash digest
SHA256 2432ce0d9d3466986b4866edc35693f7464dc636d6373f6ba1b54f5a455c946f
MD5 236603dd9ae91408f03af9d1c997cdbb
BLAKE2b-256 9e9340c1d63714173e98eb91c063fb70cb5b55ef658f43bda8dcf10a7c0da7ba

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp314-cp314t-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 3cfad117e3e86d390d993da3c52116b2d1d6311ffed214f2f07753fa3833d7fe
MD5 b4abaac985edc259b26d76c2e78d8c3e
BLAKE2b-256 ec11ee83da5b2c222b90f648e74d6319cc15328f9a1964e2174821eeb59cf45b

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp314-cp314t-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 60f659e7a285f3dcb09edd497682f024bcb24fc0d194cd01b44b8b528459cac2
MD5 0014910c37e3d91ff499182f41a7676c
BLAKE2b-256 043dd9c74c0776e780f1912ec71d597534ab0c41d936e61d737e6f54ac5cd14d

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp314-cp314t-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 3618972ba810bc98f2149f1c18cf38b6f4124d6f2e4080604f6badc255342815
MD5 9af334d158302d8ae7fb627e7b3013a2
BLAKE2b-256 6645f2c7504697a744b0aa1f6192fcefbe104f0fb5edf381cb28ec8d7fdecabd

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp314-cp314t-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 2751d13431b870816ce08a5eaca64c0c9a2e1197ff3ca37220a2a369f5410e6a
MD5 9a3ea3de2cb07948d3b0818579d526ea
BLAKE2b-256 0e34c4e3d0df0a49d298e1c7ecf96cff84d879eec3127d8ee98722e7d42bbc71

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp314-cp314t-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 34ef6a6e2e40a8e15fb10e711e6654b35bcd70455ba8f24a1f6a1dc6a22a4a1b
MD5 a17ae8a323299af9a2f9eb3c9067a803
BLAKE2b-256 67194cb8d067017d8894563afcd6b81ea9028dd82b9a697679355b2d8cfbef1c

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp314-cp314t-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 59a587c18b31b8440f9da709c429e3af1153359b87caa1553cd7aeb02fa24063
MD5 ef95097ca72108f35c4373626ea9c0b7
BLAKE2b-256 cbfbd4645aa81af9487f8da816d2d7a0977730d5d906b1df56ffb1ac1f23e933

See more details on using hashes here.

Provenance

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

File metadata

  • Download URL: bolivar-2.1.0-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.1.0-cp311-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 13879d8a4008abc875a8701eb60e513b8d3f24ed22321cb8923e1dca4a91cc7f
MD5 397a02d07d71642810a86045157a1a8a
BLAKE2b-256 6602936b46a2728c54a8b1d5af01a20946222c99b7f433abbad264c6aa9d8e74

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp311-abi3-musllinux_1_2_x86_64.whl
Algorithm Hash digest
SHA256 a23953e6f516b72edefc583d3643346402c80bb8a27e3541786d31422daca07b
MD5 05ba9180e9d4bb90ba6e30ea91f75693
BLAKE2b-256 26674c6b7c7084dc367e00ea4b8c7608f7be7375db26bb5cb1c6088fe258ae82

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp311-abi3-musllinux_1_2_aarch64.whl
Algorithm Hash digest
SHA256 c165eda9340a72fe55dfe863b2b52d6d0b251c6f659d6b478802a7a20a88ddcc
MD5 1895b6108d081c7353c1f33de45b6afe
BLAKE2b-256 d2bf7db934c81a0957d3e196832da4905c5a1b3219085146930b2039515cd98a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp311-abi3-manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 cf5881a53d89bd3bcd989c91edbe3960eb47be334decd93273b557808c199e23
MD5 19e62967bb95eda15a199b1ad1ece8c9
BLAKE2b-256 c96c0ed09e9cd32d6172964412273200c81d8b2d380164f1f35e4c625cbd897a

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp311-abi3-manylinux_2_28_aarch64.whl
Algorithm Hash digest
SHA256 fb0408c317a0a5bfe23d4506e49efa77d762a5b498ae872d46d5ea76abc593ce
MD5 e9ef3df5afd630c257847f05fecf1fb9
BLAKE2b-256 565669ddc2bfaf0e8b2dbf9af4b4370df1607223b6d66be98252ad8000f68c87

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp311-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 d8f5d9b979ba6a72670fb0ce39e5700832cde994515bb266774cd04ff05a812b
MD5 8ab1f040eb147627a8abc800d5a3ae06
BLAKE2b-256 6151fee8de5204beaf6f49c8adfce6877ab29eebc9b72605a1c7f1fcaaad80b6

See more details on using hashes here.

Provenance

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

File metadata

File hashes

Hashes for bolivar-2.1.0-cp311-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a957ca3bebc38dfad7cbad9071d44bf452ad46569f645be16b4321b8491962e4
MD5 f6949a959198a2483a83a9f0f624c537
BLAKE2b-256 9e35b890eb6f902518fb865191e0b4020faf13ca7df9c9392f78d83d4abc35f1

See more details on using hashes here.

Provenance

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

This release

2.1.0 This release

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