SID SDK
sid-sdk provides the context-management layer used to turn search results
into compact, model-facing document views. It assigns stable short document
IDs, selects relevant snippets, tracks the exact character ranges already
shown, masks repeated text, and renders the trained <doc> format.
Snippet selection is implemented in Rust using Alyze Unicode UAX #29 tokenization. It ranks fixed source-token windows with separate unigram and bigram BM25 streams, so exact phrases receive evidence without preventing single-term matches. Returned ranges are Python character offsets into the original text.
Installation
pip install sid-sdk
Prebuilt ABI3 wheels require no Rust compiler on supported macOS, Linux, and Windows platforms. Linux wheels use portable manylinux tags rather than being tied to one distribution, so the same wheel works across current Debian, Ubuntu, and other compatible glibc-based distributions. Building the source distribution requires Python 3.12+ and Rust 1.88 or newer.
Published wheels cover macOS (Apple Silicon and Intel), Windows x86-64, manylinux2014 (x86-64 and ARM64), and musllinux 1.2 (x86-64 and ARM64). CI also installs the manylinux wheel in supported Debian and Ubuntu releases; separate per-distribution wheels would be byte-for-byte redundant with Python's Linux wheel compatibility model.
Basic use
from sid import DocumentCache
cache = DocumentCache(language="english")
cache.add_document(
"database-id",
{"title": "Example", "content": "The complete document text ..."},
)
view = cache.apply_snippet(
"database-id",
snippet_field="content",
query="complete document",
)
print(view.render_xml())
cache.update_seen(view)
DocumentCache accepts danish, dutch, english, finnish, french,
german, hungarian, italian, norwegian, portuguese, russian,
spanish, and swedish. These analyzers lowercase and remove the matching
Alyze stopwords. Use generic for lowercase Unicode tokenization without
stopword removal. Pass language= to apply_snippet to override the cache
default for one call; forks inherit the default.
Development
uv sync --group dev
uv run maturin develop --locked
uv run pytest -rxX --strict-markers
cargo test --locked
The two strict xfails in the current suite document pre-existing rendering format differences. They are intentionally not snippet-selector tests.
License
MIT. See LICENSE and THIRD_PARTY_NOTICES.md.
Metadata
Release files for sid-sdk 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| sid_sdk-0.1.0.tar.gz | 89.0 kB | With provenance | Details for sid_sdk-0.1.0.tar.gz |
Built distributions (wheels)
Total release size: 2.9 MB
Release files / sid_sdk-0.1.0.tar.gz
| Download URL | sid_sdk-0.1.0.tar.gz |
|---|---|
| Size | 89.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
788cb7b80cbfe0b30202f701b948cb89502ac97a5cb6aad9acb5891123398d76
|
|
BLAKE2b-256 checksum How to use checksums |
8d360927fabdbaf36f8b8874b01371348425c611a3805795ac3b024ff2debab3
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / sid_sdk-0.1.0-cp312-abi3-win_amd64.whl
| Download URL | sid_sdk-0.1.0-cp312-abi3-win_amd64.whl |
|---|---|
| Size | 258.9 kB |
| Tags | CPython 3.12 Windows x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
727dcd7843e04a6023fcb0ec846ff5ae7ef2bddaa9a57694f7221a92f886c1e9
|
|
BLAKE2b-256 checksum How to use checksums |
fd3af374c3a158e91e1ebe24c11fcd145f99f2c8cb6bdc014771fc729f1053ef
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / sid_sdk-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl
| Download URL | sid_sdk-0.1.0-cp312-abi3-musllinux_1_2_x86_64.whl |
|---|---|
| Size | 590.1 kB |
| Tags | CPython 3.12 Linux musl 1.2+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
cc5b1bd26fd525d04e5de867b8205c87f5821f392158c73680efda8bdf73245f
|
|
BLAKE2b-256 checksum How to use checksums |
2cc411d92fcc239d605fdf4e7e67c06da9fcbc690d97d27a76719ed6a875c254
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / sid_sdk-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl
| Download URL | sid_sdk-0.1.0-cp312-abi3-musllinux_1_2_aarch64.whl |
|---|---|
| Size | 542.3 kB |
| Tags | CPython 3.12 Linux musl 1.2+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
52cdd7f6f0d49c47f1edc1251754d25b744dbf674ea1266a68df6d660c64cb81
|
|
BLAKE2b-256 checksum How to use checksums |
507dee90311a8e068e2ef7b369ffcb1c54def652cf95c23620d5ab0d0eea533a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / sid_sdk-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
| Download URL | sid_sdk-0.1.0-cp312-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl |
|---|---|
| Size | 379.3 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ x86-64 abi3 |
|
SHA-256 checksum How to use checksums |
6fded91691962e1161c139e9f1df335a45236771e266c0f69626c59ba196985f
|
|
BLAKE2b-256 checksum How to use checksums |
bfd1d9506dbd382913ed098c7b854558ed99eb06020ef82dae936936cd4409da
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / sid_sdk-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
| Download URL | sid_sdk-0.1.0-cp312-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl |
|---|---|
| Size | 364.2 kB |
| Tags | CPython 3.12 Linux glibc 2.17+ ARM64 abi3 |
|
SHA-256 checksum How to use checksums |
41f469b7ee000dd29a69579315f4019518c3fc14b3225747dfb561f35acce4c6
|
|
BLAKE2b-256 checksum How to use checksums |
0f29661ebc3290e335387beb7e475292b22c2176333989f101363a75bce0cbec
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / sid_sdk-0.1.0-cp312-abi3-macosx_11_0_arm64.whl
| Download URL | sid_sdk-0.1.0-cp312-abi3-macosx_11_0_arm64.whl |
|---|---|
| Size | 325.3 kB |
| Tags | CPython 3.12 abi3 macOS 11.0+ ARM64 |
|
SHA-256 checksum How to use checksums |
12b86aceb90257df862f74e602d31baa1d7ad954486380c44f4921e91a33b659
|
|
BLAKE2b-256 checksum How to use checksums |
d03bb9ac051aba4894dc9ba3293454a4e188762c8d21c411677f38e08f7cee82
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logRelease files / sid_sdk-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl
| Download URL | sid_sdk-0.1.0-cp312-abi3-macosx_10_12_x86_64.whl |
|---|---|
| Size | 332.6 kB |
| Tags | CPython 3.12 abi3 macOS 10.12+ x86-64 |
|
SHA-256 checksum How to use checksums |
d41be5d3359dacc1657569b39433334363e5b4271b71997b6d249872fc53ac17
|
|
BLAKE2b-256 checksum How to use checksums |
d87bfd4757f28f42b9256a9c5e00c020ee15732573e5e87260c76385967132e2
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.14
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logSecurity for sid-sdk 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
All 8 files in this release have been uploaded with provenance metadata.
Attestation for sid_sdk-0.1.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Aug 31, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.