Skip to main content

Rate limiting for callable functions

Project description

license

Function-Limiter provides rate limiting features to callable function.

Quickstart

Add the rate limiter to your function as decorator. The following example uses the default in memory implementation for storage.

from function_limiter.limiter import Limiter
from function_limiter.limiter import RateLimitExceeded
import time

limiter = Limiter()


@limiter.limit('3/second', 'key')
def function():
    print('hello world!')


for i in range(5):
    function()
    time.sleep(1)

for i in range(5):
    function()
    time.sleep(0.9)

Changelog

v0.0.8.1

Release Date: 2021-01-19
  • Bug Fixed.

v0.0.8

Release Date: 2021-01-17
  • Bug Fixed.

v0.0.7

Release Date: 2021-01-17
  • Bug Fixed.

v0.0.6

Release Date: 2021-01-16
  • Added redis as in memory storage.

v0.0.5

Release Date: 2021-01-16
  • Added garbage collector.

v0.0.4

Release Date: 2021-01-16
  • Added Validator to limiter.

v0.0.3

Release Date: 2021-01-14
  • Added callable function for limitation and key function.

v0.0.2

Release Date: 2021-01-14
  • Bug fixed.

v0.0.1

Release Date: 2021-01-13
  • Basic Function Limiter.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

Function-Limiter-0.0.8.2.tar.gz (20.1 kB view hashes)

Uploaded Source

Built Distribution

Function_Limiter-0.0.8.2-py3-none-any.whl (5.0 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page