Skip to main content

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.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for scrub.bot 0.1.4
File Size Uploaded Provenance
scrub_bot-0.1.4.tar.gz 281.8 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for scrub.bot 0.1.4
File Interpreter ABI Platform
scrub_bot-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 653.7 kB

Release files / scrub_bot-0.1.4.tar.gz

Download URL scrub_bot-0.1.4.tar.gz
Size 281.8 kB
Tags Source
SHA-256 checksum
How to use checksums
fe726a3f5a21074b647074a19e87ca0fa292c22ed6d1f67823beb3e00378c87e
BLAKE2b-256 checksum
How to use checksums
375eb7a51775d48adf51dcc64bf3a36613116f3396d6ecbc597275d02ec90f72
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 log

Release files / scrub_bot-0.1.4-py3-none-any.whl

Download URL scrub_bot-0.1.4-py3-none-any.whl
Size 371.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
3c1fc5d124f31d41c6815693edd7c07a77d159444254a38411f0a00e8ef5f3cd
BLAKE2b-256 checksum
How to use checksums
a58ee88379c7762fea1aaa89ca08ffda239cc15159771e5cb644bc07af50bd02
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 log

Security for scrub.bot 0.1.4

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.

Select from 2 files

Attestation for scrub_bot-0.1.4.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 log

A 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.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page