Python bindings for stella anonymization core
Project description
stella-anonymize-core
Python bindings for the stella anonymization Rust core.
Install
Prebuilt wheels are published to PyPI (this activates with the next release). Wheels ship the bundled native pipeline packages, so no monorepo checkout is needed:
uv add stella-anonymize-core
# or: pip install stella-anonymize-core
Wheels target Python 3.11+ (abi3) on manylinux x64/aarch64, macOS x64/arm64,
and Windows x64. Only wheels are published; there is no source distribution.
The build.rs step needs the monorepo's generated .stlanonpkg native
pipeline packages, so a source build cannot be self-contained. To build from a
checkout instead, run bun run build first so those packages exist, then:
uv add ./crates/anonymize-py
Usage
Prepare or load the anonymizer once, then reuse it for documents.
import stella_anonymize as anonymize
languages = anonymize.available_default_native_pipeline_languages()
prepared = anonymize.preload_default_native_pipeline(
language="en" if "en" in languages else None
)
result = prepared.redact_text(text, redact_string="***")
print(result.redaction.redacted_text)
Regional codes use the exact package when present and otherwise fall back to
the base language package, so en-US can use the shipped en artifact.
For caller-owned configs, prepare package bytes before serving documents and load them at runtime:
import stella_anonymize as anonymize
package_bytes = anonymize.prepare_search_package(config_json)
prepared = anonymize.load_prepared_package(package_bytes)
prepared.warm_lazy_regex()
result = prepared.redact_text(text, redact_string="***")
get_default_native_pipeline() defers lazy regex warmup by default so the first
call only pays for regexes the document actually touches. Use
preload_default_native_pipeline() or pass warmup="lazy-regex" when startup can
absorb that cost before serving documents. Top-level redact_text() and
redact_text_json() are available for one-off calls, but they prepare from config
on each invocation. Use load_prepared_package() or load_prepared_package_file()
for repeated document processing.
API
prepare_search_package(config_json | config_bytes | config_mapping, compressed=True) -> bytesload_prepared_package(package_bytes) -> PreparedAnonymizerload_prepared_package_file(package_path) -> PreparedAnonymizeravailable_default_native_pipeline_languages() -> tuple[str, ...]read_default_native_pipeline_package_file(language=None) -> bytesget_default_native_pipeline(language=None, package_path=None, warmup="none") -> PreparedAnonymizerpreload_default_native_pipeline(language=None, package_path=None) -> PreparedAnonymizerPreparedAnonymizer.warm_lazy_regex()PreparedAnonymizer.warm_lazy_regex_diagnostics_json()PreparedAnonymizer.redact_text(text, operators=None, redact_string=None)PreparedAnonymizer.redact_text_json(text, operators=None, redact_string=None)PreparedAnonymizer.diagnostics_json(text, operators=None, redact_string=None)
PreparedSearch is an alias for PreparedAnonymizer.
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 stella_anonymize_core-2.0.0-cp311-abi3-win_amd64.whl.
File metadata
- Download URL: stella_anonymize_core-2.0.0-cp311-abi3-win_amd64.whl
- Upload date:
- Size: 26.1 MB
- Tags: CPython 3.11+, Windows x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a0158d54b97b1e069ddc6dcba161a1dcbfec5d38bded6e6dd4dad47c6db9f6d3
|
|
| MD5 |
c978a4ea33b39155ab75164b44987c69
|
|
| BLAKE2b-256 |
b158721b8410c6ce9aa7bf469a0ac083a3bcdd90c1b9216165d6381a3e36120f
|
Provenance
The following attestation bundles were made for stella_anonymize_core-2.0.0-cp311-abi3-win_amd64.whl:
Publisher:
release.yml on stella/anonymize
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stella_anonymize_core-2.0.0-cp311-abi3-win_amd64.whl -
Subject digest:
a0158d54b97b1e069ddc6dcba161a1dcbfec5d38bded6e6dd4dad47c6db9f6d3 - Sigstore transparency entry: 2100006319
- Sigstore integration time:
-
Permalink:
stella/anonymize@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stella
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file stella_anonymize_core-2.0.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl.
File metadata
- Download URL: stella_anonymize_core-2.0.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl
- Upload date:
- Size: 26.2 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
1f9787c52105296d0df32590279e1edbab8165bfab23d42ebf095e1db8458395
|
|
| MD5 |
b295f053bad0e7df233f7b9875b71952
|
|
| BLAKE2b-256 |
f2d8537b5e1a5f44205809abc2802803186eaea1c843ef07940ebd47f171f728
|
Provenance
The following attestation bundles were made for stella_anonymize_core-2.0.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl:
Publisher:
release.yml on stella/anonymize
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stella_anonymize_core-2.0.0-cp311-abi3-manylinux_2_17_x86_64.manylinux2014_x86_64.whl -
Subject digest:
1f9787c52105296d0df32590279e1edbab8165bfab23d42ebf095e1db8458395 - Sigstore transparency entry: 2100004048
- Sigstore integration time:
-
Permalink:
stella/anonymize@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stella
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file stella_anonymize_core-2.0.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl.
File metadata
- Download URL: stella_anonymize_core-2.0.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl
- Upload date:
- Size: 26.0 MB
- Tags: CPython 3.11+, manylinux: glibc 2.17+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3e7073a28028943b3331a36a88bb59c185fffd218380983a4113cf2830540b55
|
|
| MD5 |
2c3d99d71204bbf9d02a486c0e328f16
|
|
| BLAKE2b-256 |
d47c3730bf2db2ef61ab4031673bb839006862e70849fcb9da8251c8954ab0f4
|
Provenance
The following attestation bundles were made for stella_anonymize_core-2.0.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl:
Publisher:
release.yml on stella/anonymize
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stella_anonymize_core-2.0.0-cp311-abi3-manylinux_2_17_aarch64.manylinux2014_aarch64.whl -
Subject digest:
3e7073a28028943b3331a36a88bb59c185fffd218380983a4113cf2830540b55 - Sigstore transparency entry: 2100004607
- Sigstore integration time:
-
Permalink:
stella/anonymize@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stella
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file stella_anonymize_core-2.0.0-cp311-abi3-macosx_11_0_arm64.whl.
File metadata
- Download URL: stella_anonymize_core-2.0.0-cp311-abi3-macosx_11_0_arm64.whl
- Upload date:
- Size: 25.9 MB
- Tags: CPython 3.11+, macOS 11.0+ ARM64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f4abfc0115f5c7064b8d2d7085a3326430aa1b2ce2f8d77508d7456335e6e1d1
|
|
| MD5 |
163c34d9a9b23d9d05d1614c6a6c24b2
|
|
| BLAKE2b-256 |
168d313d1feece0c276c02f31d6f6109fc19e3f5fdcce799ccd536f105d950dc
|
Provenance
The following attestation bundles were made for stella_anonymize_core-2.0.0-cp311-abi3-macosx_11_0_arm64.whl:
Publisher:
release.yml on stella/anonymize
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stella_anonymize_core-2.0.0-cp311-abi3-macosx_11_0_arm64.whl -
Subject digest:
f4abfc0115f5c7064b8d2d7085a3326430aa1b2ce2f8d77508d7456335e6e1d1 - Sigstore transparency entry: 2100005600
- Sigstore integration time:
-
Permalink:
stella/anonymize@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stella
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file stella_anonymize_core-2.0.0-cp311-abi3-macosx_10_12_x86_64.whl.
File metadata
- Download URL: stella_anonymize_core-2.0.0-cp311-abi3-macosx_10_12_x86_64.whl
- Upload date:
- Size: 26.1 MB
- Tags: CPython 3.11+, macOS 10.12+ x86-64
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
a3ea8cd910460975511ae489878c17c061ce055bb783b7aecc8846d491a4b784
|
|
| MD5 |
7de83e8beb30168539b158c65e2e10cb
|
|
| BLAKE2b-256 |
2969580dc8b6187730899dec0639241e4526d346e8a0564eee7e133c4037de5c
|
Provenance
The following attestation bundles were made for stella_anonymize_core-2.0.0-cp311-abi3-macosx_10_12_x86_64.whl:
Publisher:
release.yml on stella/anonymize
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
stella_anonymize_core-2.0.0-cp311-abi3-macosx_10_12_x86_64.whl -
Subject digest:
a3ea8cd910460975511ae489878c17c061ce055bb783b7aecc8846d491a4b784 - Sigstore transparency entry: 2100005317
- Sigstore integration time:
-
Permalink:
stella/anonymize@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Branch / Tag:
refs/heads/main - Owner: https://github.com/stella
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
release.yml@b6a7139a6c59e3c56ba935a6f534fe6ab388b594 -
Trigger Event:
workflow_dispatch
-
Statement type: