Python SDK
Track usage, manage quotas, and enforce rate limits with Python
The Limitry Python SDK provides a simple, type-safe way to integrate usage tracking and quota management into your Python applications.
Quick Links
Installation
Install the Python SDK
Quickstart
Track your first event
SDK Reference
Complete API documentation
Common Tasks
Track Events
Send usage data to Limitry
Check Quotas
Enforce usage limits
Analytics
Query usage data
Error Handling
Handle errors gracefully
Quick Start
from limitry import Limitry
client = Limitry(api_key="your-api-key")
# Track usage
client.track(
customer_id="cust_123",
event="api_call",
value=1
)
# Check quota
result = client.check_quota(
customer_id="cust_123",
quota_id="api_calls"
)
if result.allowed:
# Proceed with the operation
passLearn the Concepts
New to usage metering? Start with the fundamentals:
- Core Concepts - Understand events, quotas, and rate limits
- Event Types - Types of events you can track
- Quota Dimensions - How quotas are calculated