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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyspoor-0.8.11-cp39-abi3-win_amd64.whl.
File metadata
- Download URL: pyspoor-0.8.11-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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2c696acc6e17c5611f7b104423c73af089886e2838bd7474a04e659ad3cf6fc0
|
|
| MD5 |
fdb5ad23dee6ee24b30399ca80c12fa2
|
|
| BLAKE2b-256 |
8092fdadcf7a6bda2cf8d58ad62ed139f973d9dc9f061c62833f1099360b8588
|
Provenance
The following attestation bundles were made for pyspoor-0.8.11-cp39-abi3-win_amd64.whl:
Publisher:
release-bindings.yml on harrisonwang/spoor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyspoor-0.8.11-cp39-abi3-win_amd64.whl -
Subject digest:
2c696acc6e17c5611f7b104423c73af089886e2838bd7474a04e659ad3cf6fc0 - Sigstore transparency entry: 1898375635
- Sigstore integration time:
-
Permalink:
harrisonwang/spoor@38bbe768d55c9ba03635175c6da6402298fd5810 -
Branch / Tag:
refs/tags/v0.8.11 - Owner: https://github.com/harrisonwang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-bindings.yml@38bbe768d55c9ba03635175c6da6402298fd5810 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyspoor-0.8.11-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: pyspoor-0.8.11-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 1.6 MB
- Tags: CPython 3.9+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
da664f2f0638a288e2cdd4518397fd99f94dfea43d730ef2c6c286416ea46f00
|
|
| MD5 |
6a120abc8721986fb4fa12bf00b559b3
|
|
| BLAKE2b-256 |
3e718cd31b0609643b0d601dbf35b6a60efc999121b2c2e0182ef8f166b2ff97
|
Provenance
The following attestation bundles were made for pyspoor-0.8.11-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release-bindings.yml on harrisonwang/spoor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyspoor-0.8.11-cp39-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
da664f2f0638a288e2cdd4518397fd99f94dfea43d730ef2c6c286416ea46f00 - Sigstore transparency entry: 1898375795
- Sigstore integration time:
-
Permalink:
harrisonwang/spoor@38bbe768d55c9ba03635175c6da6402298fd5810 -
Branch / Tag:
refs/tags/v0.8.11 - Owner: https://github.com/harrisonwang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-bindings.yml@38bbe768d55c9ba03635175c6da6402298fd5810 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyspoor-0.8.11-cp39-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: pyspoor-0.8.11-cp39-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.9+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3c26b05c134038a53d4f4612882e6c216f94285052b8a50928fd81981dc92cdb
|
|
| MD5 |
2a864e12da67755e6727711b65bcfe5c
|
|
| BLAKE2b-256 |
27d45c074286805ccbe0887bb700ace6dbc686a0c0fbc2864eb20e06b63db376
|
Provenance
The following attestation bundles were made for pyspoor-0.8.11-cp39-abi3-macosx_11_0_arm64.whl:
Publisher:
release-bindings.yml on harrisonwang/spoor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyspoor-0.8.11-cp39-abi3-macosx_11_0_arm64.whl -
Subject digest:
3c26b05c134038a53d4f4612882e6c216f94285052b8a50928fd81981dc92cdb - Sigstore transparency entry: 1898376074
- Sigstore integration time:
-
Permalink:
harrisonwang/spoor@38bbe768d55c9ba03635175c6da6402298fd5810 -
Branch / Tag:
refs/tags/v0.8.11 - Owner: https://github.com/harrisonwang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-bindings.yml@38bbe768d55c9ba03635175c6da6402298fd5810 -
Trigger Event:
push
-
Statement type:
File details
Details for the file pyspoor-0.8.11-cp39-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: pyspoor-0.8.11-cp39-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 1.5 MB
- Tags: CPython 3.9+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
0f252f0d2b9921dbc939b0f37a765358bcb462992afedec37d892a3d36c0bb62
|
|
| MD5 |
489b041383d2e94b926a344a7a668909
|
|
| BLAKE2b-256 |
4a8cf350ee5ee46f7fb5d1a4ea02b3c756626c146694a1c3806b165a6197ad96
|
Provenance
The following attestation bundles were made for pyspoor-0.8.11-cp39-abi3-macosx_10_12_x86_64.whl:
Publisher:
release-bindings.yml on harrisonwang/spoor
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyspoor-0.8.11-cp39-abi3-macosx_10_12_x86_64.whl -
Subject digest:
0f252f0d2b9921dbc939b0f37a765358bcb462992afedec37d892a3d36c0bb62 - Sigstore transparency entry: 1898375916
- Sigstore integration time:
-
Permalink:
harrisonwang/spoor@38bbe768d55c9ba03635175c6da6402298fd5810 -
Branch / Tag:
refs/tags/v0.8.11 - Owner: https://github.com/harrisonwang
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release-bindings.yml@38bbe768d55c9ba03635175c6da6402298fd5810 -
Trigger Event:
push
-
Statement type: