Skip to main content

Python bindings for the deterministic spoor document engine

Project description

pyspoor

Typed Python adapter for spoor-core.

from spoor import parse_path

result = parse_path("report.pdf")
print(result.content.value.markdown)
for warning in result.warnings:
    print(warning["code"], warning.get("location"))

Agents must inspect result.warnings; a successful parse can still report a missing PDF text layer, suspicious text, merged-table degradation, or omitted visuals.

Tables: narrowing and pagination

For CSV/XLSX, parse_bytes / parse_path accept the same narrowing options as the CLI, so callers can page through full tables instead of the default 100-row preview:

from spoor import parse_bytes

# A slice by inclusive 1-based row range (mutually exclusive with limit/offset)
parse_bytes(data, source_name="data.xlsx", sheet="Sheet1", rows=(5, 104))

# Or paginate by limit/offset and keep only some columns
parse_bytes(data, source_name="data.xlsx", columns=["分类", "金额"], limit=100, offset=200)

PDFs: page ranges

For page-oriented PDFs, pass pages (inclusive 1-based) to parse only a slice and avoid reading a large document end to end:

parse_path("report.pdf", pages=(1, 3))  # only pages 1–3

Extracting embedded media

Resolve a safe media URI emitted in the output (DOCX images, extractable PDF images) to raw bytes for handing to an external vision model:

from spoor import extract_media

image = extract_media(data, "spoor://docx/part/word/media/image1.png", source_name="report.docx")

Build locally with maturin develop.

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.

pyspoor-0.8.14-cp39-abi3-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.9+Windows x86-64

pyspoor-0.8.14-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl (1.6 MB view details)

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

pyspoor-0.8.14-cp39-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

pyspoor-0.8.14-cp39-abi3-macosx_10_12_x86_64.whl (1.5 MB view details)

Uploaded CPython 3.9+macOS 10.12+ x86-64

File details

Details for the file pyspoor-0.8.14-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: pyspoor-0.8.14-cp39-abi3-win_amd64.whl
  • Upload date:
  • Size: 1.5 MB
  • Tags: CPython 3.9+, Windows x86-64
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyspoor-0.8.14-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 9e2a0f4bad1c543542e72004f32af371ff949032e3f7dd00a5cb6ffa37926343
MD5 efb19bb1ddb0d6e2be3baf06b56d8052
BLAKE2b-256 9a46bf5984e12583f582f722a0151b6bd58e5543d5134b04d4a71c1d00990743

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspoor-0.8.14-cp39-abi3-win_amd64.whl:

Publisher: release-bindings.yml on harrisonwang/spoor

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

File details

Details for the file pyspoor-0.8.14-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyspoor-0.8.14-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 3739dc317a3fa11f7c86474ece8a0d7b2a089c993faca424cbbdf2ca164339c2
MD5 cc6e69910f201fd2eac33b644cfd20e1
BLAKE2b-256 8ceb5dff3d0124a0d185b2efa43d6b182f1cfa84bb56b12ea50547c342ab61e8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspoor-0.8.14-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:

Publisher: release-bindings.yml on harrisonwang/spoor

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

File details

Details for the file pyspoor-0.8.14-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyspoor-0.8.14-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 0b18311ce729a520e07f77d701b7080c99c43ca535f68efab3ead0fad6cd0370
MD5 edf8f295755088853448a6c3ebb02a62
BLAKE2b-256 64797a0b28a41f2756a664181515bb9b2500dc5f4402d1c39f3943ed50278586

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspoor-0.8.14-cp39-abi3-macosx_11_0_arm64.whl:

Publisher: release-bindings.yml on harrisonwang/spoor

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

File details

Details for the file pyspoor-0.8.14-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyspoor-0.8.14-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 50e14fa3263220fd9ce6970023bdfc693556a372189b2406f900324042e42ffd
MD5 357a02b87c2ffb28d9a5eaa48c22f1a3
BLAKE2b-256 ccc76a5c3e5c6db2eb64c22c48e0bd5724f94eb73efde95c32f19f5e9939f6b3

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspoor-0.8.14-cp39-abi3-macosx_10_12_x86_64.whl:

Publisher: release-bindings.yml on harrisonwang/spoor

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