Provider-agnostic async subscription management library for SaaS applications
- Multi-provider support: Stripe, Paddle, Chargebee, Lemon Squeezy
- Async-first: Built with asyncio for high performance
- Type-safe: Full type hints and Pydantic models
- Database agnostic: Works with SQLAlchemy, Redis, and more
- Event-driven: Domain events for extensibility
- FastAPI integration: Ready-to-use FastAPI routers
pip install subscriptionkoreFor optional dependencies:
pip install subscriptionkore[all] # All providers and integrationsfrom subscriptionkore import SubscriptionKore, SubscriptionKoreConfig
# Configure
config = SubscriptionKoreConfig(
default_provider="stripe",
stripe_api_key="sk_test_...",
)
# Initialize
async with SubscriptionKore(config) as sk:
# Create customer
customer = await sk.create_customer(
email="user@example.com",
name="John Doe"
)
# Create subscription
subscription = await sk.create_subscription(
customer_id=customer.id,
price_id="price_123"
)
print(f"Created subscription: {subscription.id}")Full documentation is available at Read the Docs.
See the examples/ directory for complete applications:
fastapi_app.py: FastAPI integration examplemulti_provider_app.py: Multi-provider setup
Contributions are welcome! Please see the contributing guide.
MIT License