Skip to main content

Rate Limited Queue

A Queue That Respects Rate Limits.

The original prototype for this code was written to rate-limit calls to a geocoding api via geopy.

import geopy

from rate_limited_queue import RateLimitedQueue, RateLimit

addresses = open("some_file_of_addresses.txt").read().splitlines()

# No more than ten addresses geocoded per second
rate_limit = RateLimit(duration=1, max_per_interval=10)

geocoder = geopy.geocoder.OpenMapQuest()

q = RateLimitedQueue(
                    addresses,
                    processing_function = geocoder.geocode,
                    rate_limits = [rate_limit])

# Grabs the geocoded locations, but doesn't process
# more than ten per second
geocoded_locations = q.process()

Check out the docs for more information.

Installation

It’s up on PyPI, so just do a:

pip install rate_limited_queue

or:

sudo pip install rate_limited_queue

Metadata

Release files for rate_limited_queue 0.0.6

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for rate_limited_queue 0.0.6
File Size Uploaded Provenance
rate_limited_queue-0.0.6.tar.gz 2.9 kB Without provenance Details

Release files / rate_limited_queue-0.0.6.tar.gz

Download URL rate_limited_queue-0.0.6.tar.gz
Size 2.9 kB
Tags Source
SHA-256 checksum
How to use checksums
f06126e4bddd8f4dbd120a5bee457ee4329768564b65da42c48d7e631bda7041
BLAKE2b-256 checksum
How to use checksums
6fc56dc38acc7441c673983060ac38af5b009df13b15377cb967dfea1c8c8215
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for rate_limited_queue 0.0.6

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page