Install and set up the Limitly Python SDK for your project
pip install limitly-python
poetry add limitly-python
pipenv install limitly-python
from limitly import Limitly limitly = Limitly(api_key="your_limitly_api_key")
https://api.limitly.dev
from limitly import Limitly limitly = Limitly( api_key="lk_1234567890abcdef", base_url="https://api.limitly.dev", timeout=30 )
# .env LIMITLY_API_KEY=lk_1234567890abcdef
import os from limitly import Limitly limitly = Limitly(api_key=os.getenv("LIMITLY_API_KEY"))
import asyncio from limitly import Limitly # Synchronous usage limitly = Limitly(api_key="your_api_key") result = limitly.validation.validate("user_api_key", "/api/users", "GET") # Asynchronous usage (if supported by your environment) async def validate_request(): result = await limitly.validation.validate("user_api_key", "/api/users", "GET") return result
# Install with CLI support pip install limitly-python[cli] # Use the CLI limitly --help limitly validate --api-key user_key --path /api/users --method GET
# Clone the repository git clone https://github.com/limitlydev/limitly-python.git cd limitly-python # Install in development mode pip install -e . # Install development dependencies pip install -e ".[dev]"
from typing import Dict, Any from limitly import Limitly, ValidateRequestResponse limitly = Limitly(api_key="your_api_key") def validate_user_request(api_key: str, path: str, method: str) -> ValidateRequestResponse: return limitly.validation.validate(api_key, path, method)
Was this page helpful?