Metadata-Version: 2.4
Name: safevision
Version: 1.0.0
Summary: Official Python SDK for the SafeVision visual content moderation API
Author-email: SafeVision <safevisioncontactsupport@gmail.com>
License-Expression: MIT
Project-URL: Homepage, https://safevision.guardextech.com
Project-URL: Repository, https://github.com/safevision/safevision-python
Project-URL: Documentation, https://safevision.guardextech.com/#docs
Keywords: safevision,content-moderation,nsfw,image-moderation,censorship,gore-detection,weapons-detection,api-client
Classifier: Development Status :: 5 - Production/Stable
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.8
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: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Topic :: Internet :: WWW/HTTP
Requires-Python: >=3.8
Description-Content-Type: text/markdown
Requires-Dist: requests>=2.28

# SafeVision Python SDK

Official Python client for the [SafeVision](https://safevision.guardextech.com) visual content moderation API.

Detect NSFW content, gore, weapons, and blood in images — then automatically blur or pixelate offending regions with a single API call.

## Installation

```bash
pip install safevision
```

## Quick Start

```python
from safevision import SafeVision

sv = SafeVision(api_key="sv_live_your_key_here")

# Scan an image
result = sv.scan("photo.jpg")
print(result["safe"])        # True or False
print(result["categories"])  # detected classes + bounding boxes
print(result["latency_ms"])  # inference time in milliseconds

# Censor violations (blur / pixelate / black_box)
if not result["safe"]:
    censored_bytes = sv.censor("photo.jpg", result, mode="blur")
    with open("censored.jpg", "wb") as f:
        f.write(censored_bytes)
```

## Parameters

| Parameter | Type | Default | Description |
|-----------|------|---------|-------------|
| `api_key` | str | required | Your `sv_live_…` API key from the dashboard |
| `base_url` | str | `https://safevision.guardextech.com` | API server URL |

## Methods

### `scan(image_path)` → dict
Scans an image and returns safety verdict + bounding box coordinates.

### `censor(image_path, moderation_results, mode)` → bytes
Applies blur, pixelate, or black_box to detected regions. Returns censored image bytes.

## Links

- 📖 [Documentation](https://safevision.guardextech.com/#docs)
- 🔑 [Get API Key](https://safevision.guardextech.com/#dashboard)
- 📧 [Support](mailto:safevisioncontactsupport@gmail.com)
