🐷 Oinker¶
A delightfully Pythonic library for managing domains at Porkbun. 🐽
Oinker provides a modern, type-safe Python interface to the Porkbun API. DNS records, DNSSEC, SSL certificates, URL forwarding, and more. Async-first for performance, with sync wrappers for simplicity.
✨ Features¶
- Complete API coverage - DNS, DNSSEC, SSL, domains, URL forwarding, glue records
- Async-first design - Built on httpx for modern async/await support
- Type-safe records - Dataclasses with validation for all DNS record types
- Sync wrappers - Use
Pigletwhen you don't need async - CLI included - Manage domains from the command line
- Auto-retry - Exponential backoff for transient failures
- Python 3.13+ - Modern Python with full type annotations
🚀 Quick Example¶
from oinker import AsyncPiglet, ARecord
async with AsyncPiglet() as piglet:
# Test connection
pong = await piglet.ping()
print(f"Your IP: {pong.your_ip}")
# Create an A record
record_id = await piglet.dns.create(
"example.com",
ARecord(content="1.2.3.4", name="www")
)
print(f"Created record: {record_id}")
📦 Installation¶
For CLI support:
🔑 Authentication¶
Set your Porkbun API credentials as environment variables:
Or pass them directly:
from oinker import AsyncPiglet
async with AsyncPiglet(api_key="pk1_...", secret_key="sk1_...") as piglet:
...
📚 What's Next?¶
- Getting Started - Installation and first steps
- Async vs Sync - When to use which client
- CLI Reference - Command-line usage
- API Reference - Full API documentation