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.1.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.1-py3-none-any.whl (4.1 MB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: siren_debug-0.1.1.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.1.tar.gz
Algorithm Hash digest
SHA256 0912934f487e4184eab64f65fa54b2423980e49f80f1a6e492f022fcd7211b06
MD5 36a116e9cb321bd1df7da3c4d3c7d2dc
BLAKE2b-256 11185128ae8ffcbf7249d145c61cb6b34b4d5af816aae71f1249f38f65b5b39b

See more details on using hashes here.

File details

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

File metadata

  • Download URL: siren_debug-0.1.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 ff58c49a9fce6cbc68313ef4370adc545943b27f51ae62b0e3b4a24b54f8ac32
MD5 2024c9ca5eb16e48f11d0e333e02d5e8
BLAKE2b-256 99842509cf6dd1e5588966532187903a3b703fb437595448267ed0f71cffaf78

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