Skip to main content

kotta

Throttling and quota enforcement for Django REST Framework.

kotta provides per-endpoint rate limits, tier-based quotas, and usage tracking. Tiers are database-driven so limits can be changed without a deployment. Integrates with lxcor-reggi API keys for per-key tracking.

Part of the lxcor/api-suite.

Install

pip install lxcor-kotta

Setup

# settings.py
INSTALLED_APPS = [
    ...
    'reggi',  # required
    'kotta',
]

MIDDLEWARE = [
    ...
    'kotta.middleware.KottaMiddleware',
]

REST_FRAMEWORK = {
    'DEFAULT_THROTTLE_CLASSES': [
        'kotta.throttle.AnonEndpointThrottle',
        'kotta.throttle.TierThrottle',
    ],
    'EXCEPTION_HANDLER': 'kotta.exceptions.kotta_exception_handler',
}
# urls.py
urlpatterns = [
    path('usage/', include('kotta.urls')),
]

Sync your URL patterns into the kotta endpoint registry:

python manage.py syncendpoints

Settings

Setting Default Description
KOTTA_UPGRADE_MESSAGE '' Message appended to 429 responses pointing users to upgrade

Management commands

Command Description
syncendpoints Register all URL patterns in the kotta endpoint table

License

MIT

Metadata

Release files for lxcor-kotta 0.1.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lxcor-kotta 0.1.3
File Size Uploaded Provenance Actions
lxcor_kotta-0.1.3.tar.gz 21.8 kB Without provenance Details for lxcor_kotta-0.1.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lxcor-kotta 0.1.3
File Interpreter ABI Platform Actions
lxcor_kotta-0.1.3-py3-none-any.whl Python 3 none any Details for lxcor_kotta-0.1.3-py3-none-any.whl

Total release size: 47.0 kB

Release files / lxcor_kotta-0.1.3.tar.gz

Download URL lxcor_kotta-0.1.3.tar.gz
Size 21.8 kB
Tags Source
SHA-256 checksum
How to use checksums
8abb64ad1e1c941cfc3041f1f1e28fd7ce0ddd6b64956b128932f58a9233d076
BLAKE2b-256 checksum
How to use checksums
12f03a45673ec2da8b24fabb29e23c90b923b335d306e05c164c77873d7e79d4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Release files / lxcor_kotta-0.1.3-py3-none-any.whl

Download URL lxcor_kotta-0.1.3-py3-none-any.whl
Size 25.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
8ca271100ed44ba298d81cb209500a8ad59e0ded2c83cc7f24ca17c896dd080e
BLAKE2b-256 checksum
How to use checksums
ab0cec9778a2e981933cb2fa6662f5cb40e640d5f05bd98a6cb44f1eac57ec8e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/6.2.0 CPython/3.12.3

Security for lxcor-kotta 0.1.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page