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.18-cp39-abi3-win_amd64.whl (1.5 MB view details)

Uploaded CPython 3.9+Windows x86-64

pyspoor-0.8.18-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.18-cp39-abi3-macosx_11_0_arm64.whl (1.5 MB view details)

Uploaded CPython 3.9+macOS 11.0+ ARM64

pyspoor-0.8.18-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.18-cp39-abi3-win_amd64.whl.

File metadata

  • Download URL: pyspoor-0.8.18-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.18-cp39-abi3-win_amd64.whl
Algorithm Hash digest
SHA256 31f44c1ac1c2c57eac532a1365936f59227541a3ac95b13aac4bf602b0040efc
MD5 0e5bc3e9b9eb0b649489a906fb7bf4ce
BLAKE2b-256 c165a4962f5bab4743faf55686d03f312da20e6d95198780ec5005b3280b8643

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspoor-0.8.18-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.18-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyspoor-0.8.18-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 01d62da455a2ffb2b8aebea2b3b5eb2982881b3d33f6c3ba84d40a6c092f3fc0
MD5 2cf2a0ea5289d7ab1915d3cdfa49e7ed
BLAKE2b-256 6066fffda409570071cba0d4f89ec08ec09c66ca93850b9724e62f6ebe590cc8

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspoor-0.8.18-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.18-cp39-abi3-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for pyspoor-0.8.18-cp39-abi3-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 74e537136237a5f63342b7acfb3cfccebce569df164f37123efc488a52cc78c9
MD5 f3f86b2c5c4a98d2aefda5b29dc98c8b
BLAKE2b-256 057e39aac1bbdf2976111d3b28169a9df8d8dbd7bd9a6b4247da3192648b7118

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspoor-0.8.18-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.18-cp39-abi3-macosx_10_12_x86_64.whl.

File metadata

File hashes

Hashes for pyspoor-0.8.18-cp39-abi3-macosx_10_12_x86_64.whl
Algorithm Hash digest
SHA256 a98245c1e6474dd53a2fd0b8ac1769c3abae7b5131c12e2e1f27c8812c6f66c4
MD5 aff2b66e92dc3aefce0982941fdc9ad3
BLAKE2b-256 cf604b5fda300a82decfda6146d5e4649139cee0ce3cf9714f44c65a877b968b

See more details on using hashes here.

Provenance

The following attestation bundles were made for pyspoor-0.8.18-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