Conditional iPDB - Simple conditional debugging for Python
Project description
cipdb - Conditional iPDB
Simple conditional debugging for Python with ID-based breakpoint control.
Installation
pip install cipdb
Quick Start
Control by Global State Call in Python
# Disable all debugging programmatically
cipdb.disable()
Disable all debugging by Environmental Variable
CIPDB_ID=false python your_script.py
Control by Boolean
import cipdb
cipdb.set_trace() # Identical with ipdb.set_trace()
cipdb.set_trace(False) # Identical with pass
cipdb.set_trace(os.getenv("DEBUG")) # Development vs Production
cipdb.set_trace(os.getenv("AGENT_ID")=="DebuggingAgent_01") # Runner Specific for debugging by multiple agent
Control by Breakpoint IDs
# your_script.py
def process_user(user):
cipdb.set_trace(id="validate")
validate(user)
cipdb.set_trace(id="save")
save_user(user)
cipdb.set_trace(id="notify")
send_notification(user)
# Development mode: All ID breakpoints work (no env vars needed)
python your_script.py # All ID breakpoints trigger
# Production mode: Control with environment variables
CIPDB_IDS=validate,save python your_script.py # Only stops at validate and save
CIPDB_IDS=save python your_script.py # Only stops at save
CIPDB_ID=save python your_script.py # Only stops at save (Equivalent to CIPDB_IDS=save)
Priority Logic
Global Control > CIPDB=false Environmental Variable > ID Matching > Boolean Conditioning
License
MIT
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
cipdb-0.1.0.tar.gz
(7.2 kB
view details)
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
cipdb-0.1.0-py3-none-any.whl
(7.3 kB
view details)
File details
Details for the file cipdb-0.1.0.tar.gz.
File metadata
- Download URL: cipdb-0.1.0.tar.gz
- Upload date:
- Size: 7.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
23aba28e25de79d454af48e0dda930915012c312ed8fdd43bcb56b5bf7d8b4f9
|
|
| MD5 |
c061d644072d618bdd19a67d3c1857f4
|
|
| BLAKE2b-256 |
28f92d18fe66df4883313183b16db3ec36651d4c9032f995422ba0b90927ec7d
|
File details
Details for the file cipdb-0.1.0-py3-none-any.whl.
File metadata
- Download URL: cipdb-0.1.0-py3-none-any.whl
- Upload date:
- Size: 7.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.0rc1
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b0f4c6e130900439b18726dc5d23114d8cb3235c3af490f863c4385bda989d33
|
|
| MD5 |
bb790062bfa49b124cac40f69c94a93b
|
|
| BLAKE2b-256 |
f72a396405dbbe488f232b3859e628c062912ce63da57a2ea8fc497cceaa62a6
|