Metadata-Version: 2.4
Name: bugdna
Version: 1.2.0
Summary: Deterministic exception fingerprinting, similarity comparison, and failure tracking for Python
Author: Arnab Nandy
License: MIT License
        
        Copyright (c) 2026 Arnab Nandy
        
        Permission is hereby granted, free of charge, to any person obtaining a copy
        of this software and associated documentation files (the "Software"), to deal
        in the Software without restriction, including without limitation the rights
        to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
        copies of the Software, and to permit persons to whom the Software is
        furnished to do so, subject to the following conditions:
        
        The above copyright notice and this permission notice shall be included in all
        copies or substantial portions of the Software.
        
        THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
        IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
        FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
        AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
        LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
        OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
        SOFTWARE.
        
Project-URL: Repository, https://github.com/arnabnandy7/bugdna
Project-URL: Issues, https://github.com/arnabnandy7/bugdna/issues
Keywords: bugdna,exception,fingerprinting,observability,failure-tracking,regression-detection
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: System :: Monitoring
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Provides-Extra: test
Requires-Dist: pytest>=8.0.0; extra == "test"
Requires-Dist: build>=1.2.0; extra == "test"
Dynamic: license-file

# bugdna (Python)

Deterministic exception fingerprinting, similarity comparison, regression detection, and thread-safe failure tracking for Python.

## Installation

```bash
pip install bugdna
```

## Quick Start

```python
from bugdna import generate, FailureTracker, compare_fingerprints, diff_exceptions

try:
    # application logic
    raise ValueError("Invalid account id 12345")
except Exception as exc:
    fp = generate(exc)
    print(fp.id)                 # BUGDNA-...
    print(fp.signature)          # module#func or ClassName#method
    print(fp.category)           # FailureCategory.VALIDATION
    print(fp.family)             # FailureFamily.VALIDATION
    print(fp.stability_score)    # 70..98
```

## Features

- **Zero runtime dependencies** — pure Python standard library (`hashlib`, `traceback`, `dataclasses`, `threading`).
- **Deterministic IDs** — excludes exception messages and line numbers from hashes so nearby source edits do not split failure groups.
- **Causal Chain Support** — walks `__cause__` and `__context__` chains with cycle protection to fingerprint the deepest root cause.
- **Similarity & Diffs** — `compare_fingerprints(a, b)` and `diff_exceptions(old_exc, new_exc)`.
- **Failure Tracking** — thread-safe `FailureTracker` with bounded timelines and per-minute burst detection.
- **Deployment Regression Detection** — `RegressionDetector.compare(old_snapshot, new_snapshot)` and `detect_drift(old_fp, new_fp)`.
