Metadata-Version: 2.4
Name: codewarden
Version: 0.1.0
Summary: CodeWarden Python SDK - Security and observability for your applications
License: MIT
Keywords: security,monitoring,observability,error-tracking,pii
Author: CodeWarden Team
Author-email: team@codewarden.io
Requires-Python: >=3.9,<4.0
Classifier: Development Status :: 4 - Beta
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: Programming Language :: Python :: 3.14
Classifier: Typing :: Typed
Requires-Dist: httpx (>=0.28.0,<0.29.0)
Requires-Dist: pydantic (>=2.10.0,<3.0.0)
Project-URL: Documentation, https://codewarden.io/docs
Project-URL: Homepage, https://codewarden.io
Project-URL: Repository, https://github.com/simanam/codewarden
Description-Content-Type: text/markdown

# CodeWarden Python SDK

Security and observability SDK for Python applications.

## Installation

```bash
pip install codewarden
```

## Quick Start

```python
import codewarden

# Initialize with your API key (get it from https://codewarden.io)
codewarden.init(
    dsn="cw_live_YOUR_API_KEY@api.codewarden.io",
    environment="production",
)

# Capture messages
codewarden.capture_message("User signed up successfully")

# Capture exceptions
try:
    risky_operation()
except Exception as e:
    codewarden.capture_exception(e)

# Add breadcrumbs for context
codewarden.add_breadcrumb("user", "Clicked checkout button")
```

## Features

- **Error Tracking**: Automatic exception capture with full stack traces
- **PII Scrubbing**: Automatically redacts sensitive data (emails, credit cards, etc.)
- **Security Scanning**: Scan your code for vulnerabilities
- **Breadcrumbs**: Add context to your error reports

## Framework Integration

### Flask

```python
from flask import Flask
import codewarden

app = Flask(__name__)
codewarden.init(dsn="cw_live_xxx@api.codewarden.io")

@app.errorhandler(Exception)
def handle_exception(e):
    codewarden.capture_exception(e)
    return "Error", 500
```

### FastAPI

```python
from fastapi import FastAPI
import codewarden

app = FastAPI()
codewarden.init(dsn="cw_live_xxx@api.codewarden.io")

@app.exception_handler(Exception)
async def handle_exception(request, exc):
    codewarden.capture_exception(exc)
    return {"error": "Internal error"}
```

### Django

```python
# settings.py
import codewarden
codewarden.init(dsn="cw_live_xxx@api.codewarden.io")

# In your middleware or views
codewarden.capture_exception(exception)
```

## Security Scanning

```python
from codewarden import run_security_scan

# Scan your project for vulnerabilities
result = run_security_scan("./src")

print(f"Found {result.total_count} issues")
for finding in result.findings:
    print(f"[{finding.severity}] {finding.title}")
```

## Configuration Options

```python
codewarden.init(
    dsn="cw_live_xxx@api.codewarden.io",
    environment="production",      # Environment name
    release="1.0.0",              # Your app version
    enable_pii_scrubbing=True,    # Auto-scrub sensitive data
    debug=False,                  # Enable debug logging
)
```

## Links

- [Dashboard](https://codewarden.io)
- [Documentation](https://codewarden.io/docs)
- [GitHub](https://github.com/simanam/codewarden)

## License

MIT License - see [LICENSE](../../LICENSE) for details.

