Metadata-Version: 2.5
Name: unprofane
Version: 0.1.2
Summary: Unprofane: a profanity and toxicity API that is hard to fool. Sync and async client with retries and a batch helper.
Project-URL: Homepage, https://unprofane.com
Project-URL: Documentation, https://unprofane.com/docs/
Project-URL: Source, https://github.com/unprofane/unprofane-python
Project-URL: Issues, https://github.com/unprofane/unprofane-python/issues
Author-email: Unprofane <hello@unprofane.com>
License-Expression: MIT
License-File: LICENSE
Keywords: filter,moderation,perspective-api,profanity,toxicity
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.9
Requires-Dist: httpx>=0.25
Provides-Extra: test
Requires-Dist: pytest-asyncio>=0.23; extra == 'test'
Requires-Dist: pytest>=8; extra == 'test'
Description-Content-Type: text/markdown

# unprofane

The Python client for [Unprofane](https://unprofane.com), a profanity and toxicity API that is hard to fool.

```bash
pip install unprofane
```

```python
from unprofane import Unprofane

client = Unprofane("up_live_YOUR_KEY")
r = client.check("xXsh1tXx", context="username", policy="teen")
if not r["allowed"]:
    print(r["action"], r["evasion"], r["censored"])
```

Async:

```python
from unprofane import AsyncUnprofane

async with AsyncUnprofane("up_live_YOUR_KEY") as client:
    r = await client.check("hello", context="comment")
```

`check`, `check_batch` (up to 100), `check_many` (any number, chunked), `feedback`, `usage`, `get_list`, `put_list`, `delete_list`. Retries 429 and 5xx with jitter and honours `Retry-After`; other failures raise `UnprofaneError` with the problem details and the request id. Docs: https://unprofane.com/docs/.
