No Code
The best way to write code is to write no code at all.
Writing code that does nothing is great, but sometimes you still want your code to do something. This package allows you to write nothing, and still have your code do something.
Installation
[!TIP] It is highly recommended to use a virtual environment for proper installation of the
no.pthfile.
python -m pip install no-code
Python 3.10 or a newer version is required.
Usage
This package is intended to be used as a command-line tool.
[!IMPORTANT] Make sure you are in an activated virtual environment. Using
uv runtends to break this package.
To turn your code into no code:
$ cat some_code.py
print("Hello, world! 😁")
$ no_code some_code.py > no_code.py
$ cat no_code.py
# coding: no
You can then run no code as usual:
$ python no_code.py
Hello, world! 😁
If, for some reason, you need to turn no code back into Python code:
$ yes_code no_code.py > some_code.py
$ cat some_code.py
print("Hello, world! 😁")
Troubleshooting
If you get SyntaxError: invalid syntax, make sure the line # coding: no is present at the top of your script.
If you get SyntaxError: encoding problem: no, follow the steps below to make sure the no encoding is registered on startup:
- Run
SITE_PACKAGES=$(python -c 'import sysconfig; print(sysconfig.get_path("purelib"))')to get the path to the Python site-packages directory. - Run
echo "import no_code" > "$SITE_PACKAGES/no.pth"to register thenoencoding on startup.
[!NOTE] If using PowerShell, use
$SITE_PACKAGESinstead ofSITE_PACKAGESto assign the variable.
This issue is commonly encountered when installing no-code into the user site-packages.
More details
Not satisfied with no code? The package also provides two functions to easily convert between something and nothing.
no_code.nothing(): Transform something (a string or bytes-like object) into nothing.no_code.something(): Transform nothing into something (a string or bytes-like object).
The commands no_code and yes_code also accept input from stdin if no file is provided.
$ echo "print(bool(1))" | no_code | yes_code | python
True
Credits
Inspired by Kelsey Hightower, based on INVISIBLE.js by Martin Kleppe.
License
Metadata
Release files for no-code 0.0.2
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 |
|---|---|---|---|---|
| no_code-0.0.2.tar.gz | 4.3 kB | Without provenance | Details for no_code-0.0.2.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| no_code-0.0.2-py3-none-any.whl | Python 3 | none | any | Details for no_code-0.0.2-py3-none-any.whl |
Total release size: 10.6 kB
Release files / no_code-0.0.2.tar.gz
| Download URL | no_code-0.0.2.tar.gz |
|---|---|
| Size | 4.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
08cf1274596ea1dd8418102496c7c3b85ec05bce8d8242dd59e5e959fbb07b9e
|
|
BLAKE2b-256 checksum How to use checksums |
16800d6376b4e3485dc54e2d49dbb85b7f407a19911701b6f573ff5897091106
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Release files / no_code-0.0.2-py3-none-any.whl
| Download URL | no_code-0.0.2-py3-none-any.whl |
|---|---|
| Size | 6.3 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
0beaf987fe011c8027050cb0698c548b84cdd294ce3b11bd07bf13cf13819511
|
|
BLAKE2b-256 checksum How to use checksums |
294d6dcd3ddd4f0d82972eaeb7acc74a36005e213a4d37c6c3ce444bbedafa6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
uv/0.11.5 {"installer":{"name":"uv","version":"0.11.5","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Fedora Linux","version":"43","id":"","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}
|
Security for no-code 0.0.2
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.