Metadata-Version: 2.4
Name: SwapLayer
Version: 0.2.1
Summary: Swap providers with zero vendor lock-in. For Django SaaS.
Project-URL: Homepage, https://github.com/Tunet-xyz/swap_layer
Project-URL: Documentation, https://github.com/Tunet-xyz/swap_layer/blob/main/docs/README.md
Project-URL: Repository, https://github.com/Tunet-xyz/swap_layer
Project-URL: Issues, https://github.com/Tunet-xyz/swap_layer/issues
Project-URL: Changelog, https://github.com/Tunet-xyz/swap_layer/blob/main/CHANGELOG.md
Author-email: Alex C <alex@coded.uk>
License-Expression: MIT
License-File: LICENSE
Keywords: anti-vendor-lock-in,aws,django,infrastructure,providers,saas,stripe,twilio
Classifier: Framework :: Django
Classifier: Framework :: Django :: 4.2
Classifier: Framework :: Django :: 5.0
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Programming Language :: Python :: 3
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
Requires-Python: >=3.10
Requires-Dist: django>=4.2
Requires-Dist: pydantic>=2.0.0
Requires-Dist: requests>=2.28.0
Requires-Dist: tenacity>=8.0.0
Provides-Extra: all
Requires-Dist: authlib>=1.3.0; extra == 'all'
Requires-Dist: boto3>=1.26.0; extra == 'all'
Requires-Dist: django-anymail>=10.0; extra == 'all'
Requires-Dist: django-storages[azure,s3]>=1.13; extra == 'all'
Requires-Dist: mcp>=0.9.0; extra == 'all'
Requires-Dist: stripe>=5.0.0; extra == 'all'
Requires-Dist: tenacity>=8.0.0; extra == 'all'
Requires-Dist: twilio>=8.0.0; extra == 'all'
Requires-Dist: workos>=1.0.0; extra == 'all'
Provides-Extra: aws
Requires-Dist: boto3>=1.26.0; extra == 'aws'
Requires-Dist: django-storages[s3]>=1.13; extra == 'aws'
Provides-Extra: azure
Requires-Dist: azure-storage-blob>=12.0.0; extra == 'azure'
Requires-Dist: django-storages[azure]>=1.13; extra == 'azure'
Provides-Extra: dev
Requires-Dist: django-stubs>=4.2.0; extra == 'dev'
Requires-Dist: mypy>=1.0.0; extra == 'dev'
Requires-Dist: pytest-asyncio>=0.21.0; extra == 'dev'
Requires-Dist: pytest-cov>=4.0.0; extra == 'dev'
Requires-Dist: pytest>=7.0.0; extra == 'dev'
Requires-Dist: ruff>=0.1.0; extra == 'dev'
Requires-Dist: types-requests>=2.31.0; extra == 'dev'
Provides-Extra: email
Requires-Dist: django-anymail>=10.0; extra == 'email'
Provides-Extra: identity
Requires-Dist: authlib>=1.3.0; extra == 'identity'
Requires-Dist: workos>=1.0.0; extra == 'identity'
Provides-Extra: mcp
Requires-Dist: mcp>=0.9.0; extra == 'mcp'
Provides-Extra: sms
Requires-Dist: twilio>=8.0.0; extra == 'sms'
Provides-Extra: stripe
Requires-Dist: stripe>=5.0.0; extra == 'stripe'
Description-Content-Type: text/markdown

# SwapLayer
### The Anti-Vendor-Lock-in Framework for Django

**One Interface. Any Provider. Zero Rewrites.**

---

## What is SwapLayer?

SwapLayer is a **unified infrastructure layer** for Django that protects you from vendor lock-in.

Instead of coupling your code directly to Stripe, AWS, or Twilio, you write against **one consistent interface** and swap providers by changing a single configuration line.

### The Problem

```python
# ❌ Tightly coupled - if Stripe fails, you rewrite everything
import stripe
customer = stripe.Customer.create(email='user@example.com')
```

### The Solution

```python
# ✅ Provider-agnostic - swap providers in settings
from swap_layer import get_provider
payments = get_provider('payments')
customer = payments.create_customer(email='user@example.com')
```

---

## Quick Start

### 1. Install

```bash
pip install swaplayer[stripe,email,sms]
```

### 2. Configure

```python
# settings.py
from swap_layer.settings import SwapLayerSettings

SWAPLAYER = SwapLayerSettings(
    email={'provider': 'django'},
    payments={'provider': 'stripe', 'stripe': {'secret_key': '...'}},
    sms={'provider': 'twilio', 'twilio': {'account_sid': '...'}},
    storage={'provider': 'django'},
)
```

### 3. Use Anywhere

```python
from swap_layer import get_provider

# Email
get_provider('email').send(to='user@example.com', subject='Hello')

# Payments  
get_provider('payments').create_customer(email='user@example.com')

# SMS
get_provider('sms').send(to='+1555555', message='Welcome!')
```

---

## Features

| Module | Status | Description |
|--------|--------|-------------|
| **Email** | ✅ Production | SMTP, SendGrid, Mailgun, SES |
| **Payments** | ✅ Production | Stripe (PayPal planned) |
| **SMS** | ✅ Production | Twilio, AWS SNS |
| **Storage** | ✅ Production | S3, Azure, GCS, Local |
| **Identity** | 🚧 Beta | OAuth/SSO, KYC Verification |
| **MCP Server** | ✅ Production | AI Assistant Integration |

---

## 🤖 AI Assistant Integration

SwapLayer includes an **MCP (Model Context Protocol) server** that exposes provider management as tools for AI assistants:

```bash
# Install with MCP support
pip install 'swaplayer[mcp]'

# Run the MCP server
swaplayer-mcp
```

**AI assistants can now help you:**
- Configure and switch providers through conversation
- Send test emails/SMS to verify integrations  
- Get provider setup instructions and capabilities
- Inspect your current configuration

Perfect for AI-powered development workflows! **[→ MCP Documentation](docs/mcp.md)**

---

## 📚 Full Documentation

**[→ docs/](docs/) - One doc per module:**

- **[Email](docs/email.md)** - Email providers
- **[Billing](docs/billing.md)** - Payment processing
- **[SMS](docs/sms.md)** - SMS messaging
- **[Storage](docs/storage.md)** - File storage
- **[Identity Platform](docs/identity-platform.md)** - OAuth/SSO
- **[Identity Verification](docs/identity-verification.md)** - KYC
- **[MCP Server](docs/mcp.md)** - AI assistant integration
- **[Architecture](docs/architecture.md)** - Design patterns
- **[Contributing](docs/development/contributing.md)** - Help improve SwapLayer

---

## Why SwapLayer?

✅ **Avoid Vendor Lock-in** - Never get trapped by a single provider  
✅ **Consistent Interface** - Same API across all vendors  
✅ **Type Safe** - Pydantic validation catches errors early  
✅ **Battle Tested** - Wraps proven tools (django-storages, django-anymail)  
✅ **Zero Rewrites** - Swap providers with configuration changes only  
✅ **AI-Powered** - Built-in MCP server for AI assistant integration

---

## License

MIT - Because avoiding vendor lock-in should be free.

---

**[→ Read Full Documentation](docs/README.md)**
