A library for buffering function calls
Project description
pyfuncbuffer
A simple to use decorator to buffer function calls.
Install
$ pip install pyfuncbuffer
Example usage
Let's say you have a scraper, and don't want sites to timeout you.
You can use the @buffer()
wrapper to make your function calls buffered!
from pyfuncbuffer import buffer
# A function you want to buffer
@buffer(seconds=0.5, random_delay=0.5)
def scrape_link(url) -> []: ...
links = scrape_link("https://example.org")
while True:
link = links.pop(link)
links.append(scrape_link(link))
The @buffer()
wrapper works both for regular, and class functions!
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
pyfuncbuffer-0.1.1.tar.gz
(14.7 kB
view hashes)
Built Distribution
Close
Hashes for pyfuncbuffer-0.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 8847b20d3701165679244f99270b29815b9bd333a9556db3878b41551690e31a |
|
MD5 | 1d05504e1c856b8e0d78b5cb62613b9a |
|
BLAKE2b-256 | e3ec0002bf66b43acb0c65574ff69178e37aeb50e8b6d8269b7f766e22f7ec8c |