Skip to main content

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

siren_debug-0.1.2.tar.gz (3.3 MB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

siren_debug-0.1.2-py3-none-any.whl (4.1 MB view details)

Uploaded Python 3

File details

Details for the file siren_debug-0.1.2.tar.gz.

File metadata

  • Download URL: siren_debug-0.1.2.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

Hashes for siren_debug-0.1.2.tar.gz
Algorithm Hash digest
SHA256 d68bef43dd6e95394a14441ba2af83be0d30fc64eae869b791394bfc75e20944
MD5 c9312e88e5a83fb071afedf1a5e8c7b6
BLAKE2b-256 28fd1b7b2cb31a11a27310bcaf9b0f81d33b91efd81151529e24b9bffac7d0ea

See more details on using hashes here.

File details

Details for the file siren_debug-0.1.2-py3-none-any.whl.

File metadata

  • Download URL: siren_debug-0.1.2-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

Hashes for siren_debug-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 5b9646c7298ce7d337b70db30beefbf4dbd1ab3bac17721eaa4ec604cd1454d8
MD5 f46eb61a72dc4c5cf40fe6e499aaa6e3
BLAKE2b-256 edca03ad4c97c94669592615482bf890cdde46ce1a4089c3a2336093eb2e9d30

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page