Metadata-Version: 2.4
Name: shellder
Version: 0.1.0
Summary: Python client for the Shellder prompt API
Author: Soorya Prakash R
License: MIT
Keywords: prompt,prompt-engineering,ai,shellder
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.8
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

# Shellder

Python client for the Shellder prompt API. Optimize prompts, scrub PII and run safety checks in one call.

## Install

```
pip install shellder
```

## Get an API key

Sign in at the Shellder website, open **API Management** and generate a key (starts with `shld_`).

## Usage

```python
from shellder import Shellder

client = Shellder(api_key="YOUR_API_KEY")  # or set the SHELLDER_API_KEY environment variable

prompt = client.prompts.create(
    input="Send an email to user@example.com explaining our project timeline.",
    safety_check=True,
    pii_scrubbing=True,
    optimize=True,
    preserve_variables=["user@example.com"],
)

print(prompt.output_text)  # optimized prompt (None if blocked by the safety check)
print(prompt.usage)        # e.g. {'remaining': 14, 'daily_count': 1, 'limit': 15, ...}
```

## Response

| Property | Description |
|---|---|
| `output_text` | Optimized prompt, or the PII-sanitized prompt if `optimize=False`. `None` if blocked. |
| `blocked` | `True` if the safety check blocked the request. |
| `safety` | Safety result (`is_safe`, `flagged_categories`, ...). |
| `pii` | PII result (`detected`, `entities_found`, `sanitized_prompt`). |
| `usage` | Daily usage (`remaining`, `daily_count`, `limit`). |

## Errors

```python
from shellder import Shellder, ShellderError

try:
    Shellder(api_key="bad").prompts.create(input="hi")
except ShellderError as e:
    print(e.status, e.message)  # e.g. 401 Unauthorized: API key is invalid.
```

| Status | Meaning |
|---|---|
| 400 | Bad request (missing or too long `input`). |
| 401 | Invalid API key. |
| 403 | API key is paused. |
| 429 | Daily limit reached (resets at 00:00 UTC). |

## License

MIT
