Minimalist debug tool for Python with automatic cleaner
Project description
Siren
Minimalist debug tool for Python.
Siren is a lightweight alternative to print / pprint, designed to work with any Python version, including Python 2.7, and any framework like Django, Flask, FastAPI, or pure Python.
The main goal of Siren is simple:
✔ Debug fast
✔ Remove debug lines automatically
✔ Work everywhere
✔ Zero dependencies
Features
- Works in Python 2.7+
- Works in Python 3+
- No external dependencies
- Uses print or pprint automatically
- Shows file and line number
- Can remove all debug calls automatically
- Safe cleaner using tokenize
- Works in Django / Flask / scripts / CLI
Installation (local)
Clone the repository:
git clone https://github.com/youruser/siren.git
Copy the siren folder into your project
or add it to PYTHONPATH.
Example:
from siren import siren
Usage
from siren import siren
x = 10 data = {"a": 1, "b": [1, 2, 3]}
siren(x) siren(data)
Output:
[SIREN file.py:10] 10 [SIREN file.py:11] {'a': 1, 'b': [1, 2, 3]}
Siren automatically uses pprint for complex objects.
Multiple values
siren(x, data, user)
Cleaner (remove all siren calls)
This is the main feature.
Remove all lines that call siren(...):
python -m siren.clean .
or
python siren/clean.py .
Example:
Before:
siren(x) print("hello") siren(data)
After:
print("hello")
Cleaner is safe and uses Python tokenize.
It will NOT remove comments or strings.
Why Siren?
Using print or pprint for debugging is easy, but removing them later is painful.
Siren solves this.
Use:
siren(value)
And later:
clean all
Done.
Goals
- Minimal
- Safe
- Cross-version
- No dependencies
- Easy cleanup
- Works offline
License
MIT
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file siren_debug-0.1.0.tar.gz.
File metadata
- Download URL: siren_debug-0.1.0.tar.gz
- Upload date:
- Size: 3.3 MB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
5542c153782512cd2be01c5c88c78876ca8dad57cb6fc4fac2b4541b13e212f3
|
|
| MD5 |
69d7ec4869d70e379c08aea95b932c52
|
|
| BLAKE2b-256 |
3c8d8736f9a51f4fc63cf04c2a2fc1a162bcc61ad49aec9d31b1d21bd8e92b42
|
File details
Details for the file siren_debug-0.1.0-py3-none-any.whl.
File metadata
- Download URL: siren_debug-0.1.0-py3-none-any.whl
- Upload date:
- Size: 4.1 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.14.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e86072fbffb0a1ebe6abe054516196ebdfe09fc7cbc964dccc6aa3be67d71564
|
|
| MD5 |
06a29ad4adf9ec1f10ab2c26c62b4344
|
|
| BLAKE2b-256 |
7228cfc6afbc9039bec1c4b498a031ce589a8b9a0e2c5dcc4df520231ab9081b
|