Shittier is a Python library designed to intentionally degrade the readability and maintainability of code. It is perfect for creating obfuscated, confusing, and "shitty" code for educational purposes, pranks, or testing code analysis tools. Shittier is lightweight, easy to use, and compatible with many other languages when used as a concept.
- Adds random multi-line comments to code.
- Renames variables and functions to random strings.
- Inserts unnecessary spaces and dummy assignments.
- Includes unused imports and random function calls.
- Modifies code structure to make it harder to read.
- Supports batch file transformation.
pip install shittier
git clone https://github.com/jaywyawhare/Shittier.git
cd Shittier
python setup.py install
For more information, see the documentation.
You can use the CLI to obfuscate Python files:
python main.py filename.py
- Multiple files:
python main.py file1.py file2.py
- All Python files in a directory (non-recursive):
python main.py .
- All Python files recursively in a directory:
python main.py -r .
- Output to a separate file (
.shittier.py
suffix added):python main.py filename.py --output
You can also transform Python code inside your scripts:
from src.code_transformer import shittify_code
source_code = '''
def example_function(x, y):
return x + y
'''
shitty_code = shittify_code(source_code)
print(shitty_code)
To ensure everything is working, run:
python -m unittest discover -s tests
We welcome contributions from the community! If you'd like to contribute to Shittier, please follow our Contribution Guidelines.
This project is licensed under the DBaJ-NC-CFL.