Skip to main content

Decorator that limits the calling rate of a function

Project description

Description

This decorator limits the calling rate of the decorated function. The rate is limit over every, where limit is the number of invocation allowed every every seconds. limit(4, 60) creates a decorator that limits the function calls to 4 per minute. If not specified, every defaults to 1 second.

@limit(limit, every=1)
def function(...):
    """never invoke this function more than 4 times per minute."""
    ...

Installation

The package has been uploaded to PyPI, so you can install it with pip:

pip install limit

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

limit-0.2.tar.gz (1.8 kB view details)

Uploaded Source

File details

Details for the file limit-0.2.tar.gz.

File metadata

  • Download URL: limit-0.2.tar.gz
  • Upload date:
  • Size: 1.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for limit-0.2.tar.gz
Algorithm Hash digest
SHA256 aa385922726cad7012fcefa8af1202a66bc0f2cb4b4e306f5cc02ed4728f6fb0
MD5 18613d4bdc953bd24517bbafb3abddd1
BLAKE2b-256 ae2a767c734a9ed80fc2c8e6a5304d6c394b2cdfa54130453b1705eae0a850e9

See more details on using hashes here.

Supported by

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