slopdam
A dam for AI slop: em dashes, emoji, separator lines and markdown stay out of your logs.
English | 한국어
slopdam removes the traces AI coding tools leave in log messages and console output: em dashes and look-alike lines (including the Korean ㅡ), decorative emoji, separator lines, markdown bold, curly quotes and invisible characters. It cleans messages as they are written, and finds and fixes them in source code before they are committed.
The same trace becomes different text depending on who reads it:
input : ✅ **Saved** — 3 rows processed 🎉
reader: Saved: 3 rows processed
dev : [OK] Saved - 3 rows processed
reader(default): plain text for people, such as CLI messages, alerts and reports.dev: grep-friendly text for log files and collectors. Status emoji become[OK],[FAIL]and[WARN]instead of disappearing.
Recorded from real runs on a sample project with scripts/demo/make_demo.py; every line of output is what slopdam printed.
Highlights
- One engine, two profiles. Detection is shared;
readerwrites plain sentences for people anddevkeeps information for tools. A logger can sendreadertext to the console anddevtext to a file at the same time. - Cleans logs as they are written. A
loggingformatter and filter, a structlog processor and a loguru patcher. Each handler gets its own result, tracebacks are never touched, and records that were only a separator line are dropped. - Finds traces before they are committed.
slopdam checkreads Python through the syntax tree and JavaScript, TypeScript, Java, Kotlin, Go, Rust, Ruby, PHP and Swift line by line, looking only at log and print calls. - Fixes Python safely.
slopdam fixrewrites only the text inside string literals. Quotes, prefixes, escapes, f-string expressions and%splaceholders stay, and nothing is written unless the file still compiles. - Korean-aware. The Hangul
ㅡin all three of its code points,!after Hangul, number ranges written with~as in Korean inreader, and Hangul, Hanja and kana text left alone. - Conservative by design. URLs, inline code,
key=valuevalues and file paths are protected; dates, command line flags and__name__are not mistaken for traces. Rules are deterministic, and property-based tests check that cleaning twice changes nothing. - Fits into CI. pre-commit hook, GitHub Action with pull request annotations, SARIF for code scanning, JSON output and stdin for editors. Every finding has a rule ID you can disable or ignore per line.
- Ready for other languages. The behavior is written down as a language-neutral spec with conformance cases that ports to JavaScript, Go, Java and Rust will share (roadmap).
- No runtime dependencies. Python 3.9 to 3.13, typed.
Screenshots
| Clean log output (reader on the console, dev in the file) | Find traces in Python and JavaScript |
|---|---|
| Preview fixes to Python string literals | Clean any program's output in a pipe |
Install
slopdam needs Python 3.9 or later and has no runtime dependencies.
pip install slopdam
Clean log output
import logging
from slopdam import PlainFilter, PlainFormatter
console = logging.StreamHandler() # read by people
console.setFormatter(PlainFormatter("%(message)s")) # reader profile
console.addFilter(PlainFilter()) # drop lines that were only separators
file = logging.FileHandler("app.log") # read by tools
file.setFormatter(PlainFormatter("%(asctime)s %(levelname)s %(message)s", profile="dev"))
file.addFilter(PlainFilter(profile="dev"))
logging.basicConfig(level=logging.INFO, handlers=[console, file])
logging.info("✅ Synced %s rows — done", 3)
# console: Synced 3 rows: done
# app.log: 2026-11-23 ... INFO [OK] Synced 3 rows - done
- The original log record is never modified, so each handler can use its own profile.
- Tracebacks, URLs, inline code,
key=valuevalues and file paths are left untouched.
structlog and loguru work the same way. Neither library is required by slopdam.
from slopdam.integrations.structlog import SlopdamProcessor
structlog.configure(processors=[structlog.processors.add_log_level,
SlopdamProcessor(profile="dev"),
structlog.processors.JSONRenderer()])
from slopdam.integrations.loguru import SlopdamPatcher
logger = logger.patch(SlopdamPatcher(profile="dev"))
The structlog processor cleans the event message only; pass keys=["note"] to clean other fields too.
Lint and fix source code
slopdam check src/ # report traces in log and print calls; exit 1 if any
slopdam --profile dev check src/ # suggestions in the dev style
slopdam fix --diff src/ # preview fixes to Python string literals
slopdam fix src/ # apply them
git diff | slopdam check - # check text from stdin
cat app.py | slopdam check --stdin-filename app.py - # stdin, checked like that file
src/sync.py:8:18: emoji.pictograph '✅' -> ''
src/sync.py:8:25: dash.run 'ㅡ' -> ': '
Python files are read through the syntax tree, so slopdam knows exactly where each string starts and ends. slopdam fix changes only the literal text: quotes, prefixes, escape sequences, f-string expressions and placeholders such as %s stay as they are, and nothing is written unless the result compiles. Other languages are checked line by line.
To skip a line, add # slopdam: ignore, or # slopdam: ignore[emoji] to skip one rule group.
Configuration
slopdam reads slopdam.toml, or the [tool.slopdam] table in pyproject.toml. Command line options take precedence.
profile = "dev"
level = "basic"
disable = ["emoji.status"]
[lint]
scope = "log-calls" # log-calls | strings | all
exclude = ["tests/**"]
pre-commit and CI
repos:
- repo: https://github.com/slopdam/slopdam
rev: v0.4.1
hooks:
- id: slopdam
GitHub Actions, with findings shown as annotations on the pull request:
- uses: actions/checkout@v7
- uses: slopdam/slopdam@v0.4.1
with:
paths: src/
slopdam check --format also writes json, github (workflow annotations) and sarif (GitHub code scanning and other SARIF viewers).
Exit codes: 0 clean, 1 traces found (or fix --diff has changes), 2 usage or configuration error.
Pipe
tail -f app.log | slopdam clean
Other languages
slopdam is built to work the same way in every language.
- Now:
slopdam checklints log and print calls in JavaScript, TypeScript, Java, Kotlin, Go, Rust, Ruby, PHP and Swift line by line, and the pre-commit hook and GitHub Action cover the same files.slopdam cleancleans the output of any program through a pipe:node server.js 2>&1 | slopdam clean --profile dev. - Native packages: the behavior is defined independently of Python in spec/: the rule catalog and conformance cases that every port must pass. Packages for JavaScript, Go, Java and Rust are planned in the roadmap.
Rules
Every rule has an ID such as dash.run or emoji.pictograph, and can be turned off by ID or by group (--disable emoji). Profiles decide what a trace becomes, and levels decide how far slopdam goes: basic (default), strong (also removes filler words) and strict (also reports any non-ASCII symbol). See docs/RULES.md for the full catalog.
Contributing
Contributions are welcome. Please read CONTRIBUTING.md; every commit needs a DCO sign-off (git commit -s). Report security issues privately as described in SECURITY.md. Project decisions follow GOVERNANCE.md, and the community follows the Code of Conduct.
License
MIT. Third-party components are listed in THIRD_PARTY_NOTICES.md.
Metadata
Release files for slopdam 0.4.1
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 |
|---|---|---|---|---|
| slopdam-0.4.1.tar.gz | 66.8 kB | With provenance | Details for slopdam-0.4.1.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| slopdam-0.4.1-py3-none-any.whl | Python 3 | none | any | Details for slopdam-0.4.1-py3-none-any.whl |
Total release size: 94.2 kB
Release files / slopdam-0.4.1.tar.gz
| Download URL | slopdam-0.4.1.tar.gz |
|---|---|
| Size | 66.8 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
d612343d97e96d94835bfcc4f95f8028dd37687743e35006d501085d1241d3a4
|
|
BLAKE2b-256 checksum How to use checksums |
db5c3b6f113c7fda73bf07fba90cbf40f5afafade6c9a23a2a4714cd5c73cc2a
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 23, 2026.
Transparency logRelease files / slopdam-0.4.1-py3-none-any.whl
| Download URL | slopdam-0.4.1-py3-none-any.whl |
|---|---|
| Size | 27.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
4dc2b492fa85ca557e4ff12a4c9c673d95561d1ea8ead4a582f8ddd1ab86631a
|
|
BLAKE2b-256 checksum How to use checksums |
e5dc8951d614689b58b07c999cbc35b0bb0e52d6d969d2086c4415656aa434ba
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
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 Nov 23, 2026.
Transparency logSecurity for slopdam 0.4.1
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
Both files in this release have been uploaded with provenance metadata.
Attestation for slopdam-0.4.1.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 Nov 23, 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.