Metadata-Version: 2.4
Name: kizu-core
Version: 0.1.2
Summary: Headless error tracker with Discord and Slack notifications
License: MIT License
        
        Copyright (c) 2026 Abhilash
        
        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: Homepage, https://github.com/abhi-afk-dev/kizu
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: requests
Requires-Dist: python-dotenv
Dynamic: license-file

# KIZU
> **傷 (Kizu)** — *n. wound, scar, flaw.*
A hyper-minimalist, headless Python error tracker. Catches unhandled exceptions and dispatches zero-latency, asynchronous alerts directly to Discord or Slack.

## Features
* **Zero Dependencies:** Relies strictly on `requests` and `python-dotenv`.
* **Non-Blocking:** Alerts fire in a background thread so your main app never hangs.
* **Anti-Spam Cache:** Built-in 5-minute cooldown prevents rate-limiting during cascading crashes.
* **Headless:** No central servers or dashboards. Bring your own webhook.

---

## Installation
```base
git clone [https://github.com/abhi-afk-dev/kizu.git](https://github.com/abhi-afk-dev/kizu.git)
cd kizu
pip install -e .
```

### Configuration
Create a .env file in your root directory. Kizu automatically routes to whichever webhook is provided.

DISCORD_WEBHOOK_URL="[https://discord.com/api/webhooks/](https://discord.com/api/webhooks/)..."
SLACK_WEBHOOK_URL="[https://hooks.slack.com/services/](https://hooks.slack.com/services/)..."

### Usage
Wrap any critical function or API route with the @track decorator.

```base
Python
from dotenv import load_dotenv
from kizu import track

load_dotenv()

@track
def critical_operation():
    return 1 / 0  # Kizu silently catches this crash and fires the webhook

if __name__ == "__main__":
    critical_operation()
```

## Webhook Setup Guide

### Discord (Fastest)
1. Right-click your target server channel and select Edit Channel.
2. Navigate to Integrations > Webhooks > New Webhook.
3. Click Copy Webhook URL and paste it into your .env file.

### Slack
1. Go to api.slack.com/apps in your browser.
2. Click Create New App → choose From scratch.
3. Name it (e.g., Kizu) → select your workspace → click Create App.
4. On the left sidebar click Incoming Webhooks.
5. Toggle Activate Incoming Webhooks to ON.
6. Scroll down → click Add New Webhook to Workspace.
7. Select your #bugs channel → click Allow.
8. It will generate a URL that looks like: https://hooks.slack.com/services/T00000000/B00000000/XXXXXXXX.

Copy that. That's your webhook URL. Paste it into .env and you're done.
