Code Monkey home page Code Monkey logo

ratelim's People

Contributors

back2basics avatar msempere avatar themiurgo avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar

ratelim's Issues

Decorators don't preserve function metadata

Docstrings and other attributes are not preserved when using the decorators in this package. For example:

>>> import ratelim
>>> def f():
...     """Docs"""
...
>>> f.__doc__
'Docs'
>>> f = ratelim.greedy(10, 5)(f)
>>> f
<function wrapped_f at 0x10dd041b8>
>>> f.__doc__
>>>

Other attributes that should be preserved are __name__ and __module__. In particular this is important as a decorator should aim to decorate the existing function and therefore preserve its details.

Uploading to PyPi with Zip file

Someone mentioned to me that your PyPi package doesn't contain a Zip file in your latest release.

He was running a linux OS and couldn't install it from the setup.py file.

When uploading wheel also include sdist for the zip fie.

$ python setup.py sdist bdist_wheel upload

Introduce wait times distributions

Introduce the possibility to have wait-times chosen from arbitrary distributions (e.g., gaussian, poissonian, ...), but which still respect the rate limit.

Wait shorter after long function call

Right now ratelim.patient distributes evenly function calls.

When a function call runs for longer than the wait time, the ratelimiter could make up for that lost time by sleeping for shorter intervals in next function calls. This is not currently implemented.

Python3 Compatible

I'm getting this indentation errors when I'm testing it in a Python 3.4 env.

I think it's only the latest version of PyPi, your github repo looks good.

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/ubuntu/Github/geocoder/geocoder/__init__.py", line 35, in <module>
    from .api import get, yahoo, bing, geonames, google, mapquest
  File "/home/ubuntu/Github/geocoder/geocoder/api.py", line 10, in <module>
    from .google import Google
  File "/home/ubuntu/Github/geocoder/geocoder/google.py", line 4, in <module>
    import ratelim
  File "/home/ubuntu/env/lib/python3.4/site-packages/ratelim/__init__.py", line 18
    self.__max_calls = max_calls
                               ^
TabError: inconsistent use of tabs and spaces in indentation

Git marks on __init__.py

Seems some git marks appears on init.py:

<<<<<<< HEAD

94baa8b... Remove external function for providing totalseconds to timedelta objects and make it inline using exceptions

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.