scrub.bot
ScrubBot is deterministic data cleaning for records, free text and files: spreadsheets and JSON, pasted text, PDFs and Office documents, images and audio. Its rule-based handlers trim and fix casing, standardize dates and phone numbers, repair broken encoding, strip HTML, mask PII, validate emails and remove duplicates, so the same input always gives the same output. It never invents a value; anything it can't fix with certainty is flagged with a reason. Every run returns the cleaned data, a log of every change, and a list of what it couldn't resolve. Use it in the browser, from the command line, over an API, or from AI agents through MCP; scrub serve runs the whole engine on your machine. Model-based handlers (OCR, transcription, classification) are an opt-in extra and are labeled as such.
The package contains the scrub command and the engine behind it. scrub serve starts the engine with SQLite and no other services, so nothing leaves your computer. The same CLI can also point at a hosted or self-hosted ScrubBot API. AI model handlers are an optional extra: pip install "scrub.bot[ai]".
Install
pip install scrub.bot
Requires Python 3.12 or newer. If pip reports "No matching distribution found" (older Python, such as the 3.9 that ships with macOS) or "externally-managed-environment" (Homebrew or system Python), install it as an isolated tool instead:
uv tool install scrub.bot # or: pipx install scrub.bot
Installs two commands that are the same program: scrub (short, for daily use) and scrubbot (explicit, for docs and scripts).
Start the engine
scrub serve # local API on http://127.0.0.1:8000, prints a key
In another terminal:
export SCRUBBOT_API_URL=http://127.0.0.1:8000
scrub api doctor # check key, endpoint, and version
curl -sO https://www.scrub.bot/demo/contacts.csv
scrub clean/text/whitespace contacts.csv -o contacts.clean.csv
The CLI provisions its own key against a local server. To use a hosted or self-hosted ScrubBot API instead, set SCRUBBOT_API_URL and SCRUBBOT_API_KEY. Hosted accounts are not open yet.
Run a handler
scrub handlers pii # search the catalog
scrub handlers clean/pii # show one handler and its config
scrub clean/pii customers.csv --config strategy=mask
scrub clean/text/whitespace notes.csv
scrub runs # recent run history
scrub clean/pii file.csv is shorthand for scrub run clean/pii file.csv. Input can be CSV, JSON, or inline text. Output goes to stdout or --output.
Run a pipeline
prep.yaml:
name: customer_prep
handlers:
- handler: clean/text/whitespace
config: {}
- handler: clean/pii
config: {strategy: mask}
- handler: validate/format/email
config: {}
scrub pipeline prep.yaml customers.csv
Python
import scrubbot
c = scrubbot.Client(api_key="sk_...", base_url="https://api.scrub.bot")
result = c.run_handler("clean/pii", data=[{"email": "a@b.com"}], config={"strategy": "mask"})
print(result["records"], result["changes"])
for event in c.stream_pipeline(
record_chunks=[[{"text": " hi "}]],
handlers=[{"handler": "clean/text/whitespace", "config": {}}],
):
print(event)
Errors raise scrubbot.ApiError (HTTP status and payload) or scrubbot.ApiConnectionError (unreachable or timed out). The package also ships the generated, fully typed client classes (scrubbot.HandlersApi, scrubbot.PipelineApi, scrubbot.JobsApi, and so on) for callers who want a model per endpoint.
Environment variables
| Variable | Meaning |
|---|---|
SCRUBBOT_API_KEY |
API key; overrides the saved login |
SCRUBBOT_API_URL |
API base URL; the default today is http://localhost:8000, so set this to the hosted API |
SCRUBBOT_DEFAULT_FORMAT |
Output format for runs |
SCRUBBOT_TIMEOUT |
Request timeout in seconds |
Self-hosting and license
The server is in the same repository and runs with Docker Compose. It is source-available under the Business Source License 1.1 and converts to Apache 2.0 on 2030-01-01. Internal use is permitted; offering it as a hosted service to third parties needs a commercial license. This client package follows the same license.
Docs: https://www.scrub.bot/docs. Bugs and feature requests: https://github.com/scrubbot/scrub.bot/issues.
Metadata
Release files for scrub.bot 0.1.6
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 | |
|---|---|---|---|---|
| scrub_bot-0.1.6.tar.gz | 282.6 kB | With provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| scrub_bot-0.1.6-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 655.3 kB
Release files / scrub_bot-0.1.6.tar.gz
| Download URL | scrub_bot-0.1.6.tar.gz |
|---|---|
| Size | 282.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
ea8e25465725ab9a56d2dd72aa502f48612332ffaed4d9668f684b6ff20f22ab
|
|
BLAKE2b-256 checksum How to use checksums |
29106dfd2430ba99016533982aaa3a675a6803f994b1d0bfd038f6dd77f3b1b6
|
| 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 Oct 19, 2026.
Transparency logRelease files / scrub_bot-0.1.6-py3-none-any.whl
| Download URL | scrub_bot-0.1.6-py3-none-any.whl |
|---|---|
| Size | 372.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
000856cc55f11080efb1e1c23b25de963ca8c492af493ce5575bc33cf213c628
|
|
BLAKE2b-256 checksum How to use checksums |
01a795f5d9b2b8960040afc5718005b42fc8d17fb53bd5b59cca4c91a755903a
|
| 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 Oct 19, 2026.
Transparency logSecurity for scrub.bot 0.1.6
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 2 files in this release have been uploaded with provenance metadata.
Attestation for scrub_bot-0.1.6.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 Oct 19, 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.