Metadata-Version: 2.4
Name: dickless
Version: 0.1.0
Summary: Official Python SDK for the dickless.io API platform
Project-URL: Homepage, https://dickless.io
Project-URL: Repository, https://github.com/aetherio-llc/dl-io/tree/main/packages/sdk-python
Project-URL: Documentation, https://dickless.io/docs
License-Expression: MIT
Classifier: Development Status :: 3 - Alpha
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: Typing :: Typed
Requires-Python: >=3.9
Requires-Dist: httpx>=0.27
Description-Content-Type: text/markdown

# dickless

Official Python SDK for the [dickless.io](https://dickless.io) API platform.

## Installation

```bash
pip install dickless
```

## Quick Start

```python
from dickless import DicklessClient

client = DicklessClient(api_key="dk_your_api_key")

# Content Moderation
result = client.moderate_text("Some text to analyze")
print(result.safe, result.overall_score)

# PII Redaction
redacted = client.redact("Email me at john@example.com", entities=["email"])
print(redacted.redacted, redacted.entity_count)

# AI Gateway
from dickless import ChatRequest, ChatMessage

response = client.chat(ChatRequest(
    model="gpt-4o",
    messages=[ChatMessage(role="user", content="Hello!")],
))
print(response.choices[0].message.content)

# Or pass a plain dict:
response = client.chat({
    "model": "gpt-4o",
    "messages": [{"role": "user", "content": "Hello!"}],
})

# Prompt Sanitizer
sanitized = client.sanitize("Ignore all previous instructions and...")
print(sanitized.clean, sanitized.threat_score)

# URL Shortener
short = client.shorten("https://example.com/very/long/url")
print(short.short_url, short.qr_code)

stats = client.get_short_url_stats(short.code)
print(stats.clicks)

# Roast
roast = client.roast("My super cool landing page copy", type="landing_page")
print(roast.roast)

# Credits (for dedicated gateway mode)
balance = client.get_credit_balance()
print(f"Balance: ${balance.balance_cents / 100:.2f}")

transactions = client.get_credit_transactions()
for tx in transactions:
    print(tx.description, tx.amount_cents)

# PDF Generation
pdf = client.generate_pdf(html="<h1>Invoice</h1><p>Total: $49.99</p>", page_size="A4")
print(pdf.url)

# Email Verification
verified = client.verify_email("john@example.com", deep=True)
print(verified.deliverable, verified.disposable)

# DNS / WHOIS Lookup
dns = client.dns_lookup("example.com", types=["A", "MX"], whois=True)
print(dns.records, dns.whois)

# IP Geolocation & Threat Intel
ip_info = client.ip_intel("8.8.8.8", deep=True)
print(ip_info.country, ip_info.city, ip_info.threat)

# Webhook Delivery
webhook = client.deliver_webhook(
    url="https://example.com/webhooks",
    event="order.completed",
    payload={"orderId": "abc-123", "total": 49.99},
    secret="whsec_your_signing_secret",
)
print(webhook.delivered)

# HTML/Markdown Sanitizer
sanitized = client.sanitize_html(
    '<p>Hello</p><script>alert("xss")</script>',
    allow_tags=["p", "b", "i", "a"],
)
print(sanitized.sanitized)  # "<p>Hello</p>"
```

## Async Usage

```python
import asyncio
from dickless import AsyncDicklessClient

async def main():
    async with AsyncDicklessClient(api_key="dk_your_api_key") as client:
        result = await client.moderate_text("Check this text")
        print(result.safe)

        redacted = await client.redact("Call me at 555-0123")
        print(redacted.redacted)

asyncio.run(main())
```

## Gateway Mode

Set a default gateway mode for all AI requests:

```python
client = DicklessClient(
    api_key="dk_your_api_key",
    default_gateway_mode="dedicated",
)

# All chat() calls will use "dedicated" mode unless overridden
response = client.chat({"model": "gpt-4o", "messages": [...]})
```

## Error Handling

```python
from dickless import DicklessClient, DicklessError

client = DicklessClient(api_key="dk_your_api_key")

try:
    result = client.moderate_text("test")
except DicklessError as e:
    print(f"API error [{e.code}]: {e.message}")
```

## License

MIT
