semvec/pypi-packages huggingface dataset:
tds-python-redis-rate-limit 0.0.6
Python Rate Limiter based on Redis.

python-redis-rate-limit
=======================

.. image:: https://travis-ci.org/EvoluxBR/python-redis-rate-limit.svg?branch=master
    :target: https://travis-ci.org/EvoluxBR/python-redis-rate-limit

.. image:: https://img.shields.io/pypi/v/python-redis-rate-limit.svg
    :target: https://pypi.python.org/pypi/python-redis-rate-limit


This lib offers an abstraction of a Rate Limit algorithm implemented on top of
Redis >= 2.6.0.

Example: 10 requests per second

.. code-block:: python

    from redis_rate_limit import RateLimit, TooManyRequests
    try:
      with RateLimit(resource='users_list', client='192.168.0.10', max_requests=10):
        return '200 OK'
    except TooManyRequests:
      return '429 Too Many Requests'

Example: 600 requests per minute

.. code-block:: python

    from redis_rate_limit import RateLimit, TooManyRequests
    try:
      with RateLimit(resource='users_list', client='192.168.0.10', max_requests=600, expire=60):
        return '200 OK'
    except TooManyRequests:
      return '429 Too Many Requests'

Example: 100 requests per hour

.. code-block:: python

    from redis_rate_limit import RateLimit, TooManyRequests
    try:
      with RateLimit(resource='users_list', client='192.168.0.10', max_requests=100, expire=3600):
        return '200 OK'
    except TooManyRequests:
      return '429 Too Many Requests'

Example: you can also setup a factory to use it later

.. code-block:: python

    from redis_rate_limit import RateLimiter, TooManyRequests
    limiter = RateLimiter(resource='users_list', max_requests=100, expire=3600)
    try:
      with limiter.limit(client='192.168.0.10'):
        return '200 OK'
    except TooManyRequests:
      return '429 Too Many Requests'

Example: you can also pass an optional Redis Pool

.. code-block:: python

    import redis
    from redis_rate_limit import RateLimit, TooManyRequests
    redis_pool = redis.ConnectionPool(host='127.0.0.1', port=6379, db=0)
    try:
      with RateLimit(resource='users_list', client='192.168.0.10', max_requests=10, redis_pool=redis_pool):
        return '200 OK'
    except TooManyRequests:
      return '429 Too Many Requests'
servo_tidy 0.3.0
The servo-tidy is used to check licenses, line lengths, whitespace, flake8 on Python files, lock file versions, and more.
Keywords: mozilla servo tidy

servo_tidy
==========

Servo's code and license checker.

Installation
++++++++++++

Install from PyPI:

::

  pip install servo-tidy

or from git:

::

  pip install -e git+https://github.com/servo/servo.git#egg=servo_tidy&subdirectory=python/tidy

To run the tests
++++++++++++++++

::

  ./mach test-tidy --self-test


Release History
---------------

0.3.0 (2017-02-24)
++++++++++++++++++

- Added checking for blocked packages
- Added checking for alphabetical order for JSON keys and ``#![feature(...)]``
- Improved duplicated packages checking
- Improved ordering ``use`` statements
- Allow tidy to run custom project-specific lints
- And many other improvements

0.2.0 (2016-08-09)
++++++++++++++++++

- Improve license checking to disregard comments and line breaks
- License checking verifies that COPYRIGHT is specified when apache2 is used

0.0.3 (2016-04-19)
++++++++++++++++++

- Add alternate wording of apache2 license

0.0.2 (2016-04-17)
++++++++++++++++++
- Cleanup Tidy to work on external deps

0.0.1 (2016-04-12)
++++++++++++++++++
- Package Tidy