Observed since 20 Oct, 18:17 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
Remove unsightly non-whitespace characters from your code.
Remove unsightly visible characters from your code. Inspired by the Acme::Bleach Perl module by Damian
Conway.
You can install Bleach via pip from PyPI:
$ pip install acme-bleach
Let's start with the following Python script, hello.py:
print("Hello, world!")
To bleach it, run the following command:
$ bleach bleach hello.py -o hello-bleached.py
The result is a bleached version of the original script. The contents of
hello-bleached.py are (representing tabs with »»»» and spaces with ·):
# coding=bleach
»»»»···»»»»»»»»»»»»»»»»»···»»»»»·»»»»»»»··»»·»»»»»»»·»»»··»»···»»»»»···»·»»»»»»»
»»»»»»»»·»»»·»»»»»»»»»»»»»»»»»»»·»»»»»»»»»»»·»»»»»»»·»»»»»»»·»»»»»»»»»»»»»»»··»»»»»»·»»»·»»»··»»··»»»»»»
»»»»··»»··»»»»»»»»»»··»»····»»»»»»»»·»»»··»»»»»»»»»»»»»»·»»»»»»»»»»»»»»»»»»»»»»»···»···
»»»»··»»····»»»»···»»»»»·»»»»»»»··»»··»»»»»»»»»»··»»»»»»·»»»»»»»»»»»»»»»·»»»»»»»»»»»»»»»·
»»»»»»»»·»»»»»»»»»»»·»»»»»»»»»»»·»»»·»»»»»»»·»»»»»»»»»»»»»»»·»»»·»»»
You can run the bleached file using bleach run:
$ bleach run hello-bleached.py
Hello, world!
You can unbleach the file using bleach unbleach:
$ bleach unbleach hello-bleached.py -o hello-unbleached.py
$ cat hello-unbleached.py
print("Hello, world!")
Running scripts with bleach run is far too much effort. If you want to run bleached scripts directly, you can install
the bleach codec:
$ bleach install
Wrote /home/stefans/bleach/.venv/lib/python3.10/site-packages/bleach.pth
$ python hello-bleached.py
Hello, world!
Installing the codec will attempt to write a .pth file to the site-packages directory of the current Python
interpreter. Note the import in the .pth file will be evaluated every time the current Python runs, so there is a
tiny amount of overhead.
Distributed under the terms of the MIT license, Bleach is free and open source software.
This project was generated from a variant of @cjolowicz's Hypermodern Python Cookiecutter template.
Download counts and popularity will appear here as the collector receives them.
| Version | Published | Direct dependencies | Open version |
|---|---|---|---|
| 0.2.3 | 11 Sept 2023 | 1 |
This describes our collected data; it is not a security assessment.
Shared repository data · GitHub
Public sponsor counts have not been collected. These signals belong to the repository owner.
github · 1 observations shown. Missing days are unknown.
| Date / source period | Value | Observed at |
|---|---|---|
| 2026-10-20 | 0 | 2026-10-20T20:02:26.4877463Z |
Observed since 20 Oct, 18:17 UTC
No superseded metadata states collected. Unchanged observations do not create new revisions.
package:7c35b1d1a3ffd0c1788fc9270272dfe1b0ee8f68548b0c35b8bc9f51c636c966