Skip to main content

niced_url_request

A simple wrapper class to "nice" url requests in python by setting a maximum frequency to url requests, and using a disk cache.

Motivation

I have needed several times lately to get some relatively large dataset from the net as a series of smaller http requests. This class is a convenient small wrapper for doing so without annoying the server.

Functionalities

  • limit request rate
  • cache the answers on disk
  • perform up to 10 re-tries waiting 10 seconds in between if request fails to make querying large quantities of requests robust to minor network / service interruptions

Installation

pip install niced_url_request

Tests and example

To run tests: pytest -v . from the present folder.

For a detailed example: see examples folder.

Small start up example:

from niced_url_request import NicedUrlRequest

niced_requester = NicedUrlRequest()

request_result = niced_requester.perform_request("http://httpbin.org/get?bla1=blabla1")

print(request_result.decode("ASCII"))

Metadata

Release files for niced-url-request 0.1

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

Source distribution (sdist)

Source distribution for niced-url-request 0.1
File Size Uploaded
niced_url_request-0.1.tar.gz 5.4 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for niced-url-request 0.1
File Interpreter ABI Platform
niced_url_request-0.1-py3-none-any.whl Python 3 none any Details

Total release size: 11.6 kB

Release files / niced_url_request-0.1.tar.gz

Download URL niced_url_request-0.1.tar.gz
Size 5.4 kB
Tags Source
SHA-256 checksum
How to use checksums
c2cb6d61ec0226437c6848126adc481989fea279139760be58bec6a0abdae71d
BLAKE2b-256 checksum
How to use checksums
d5c2cda1d14f67eda46eab1509a403bc0ee671bbe5a4112d7b6cbb4fefdf3f68
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

Release files / niced_url_request-0.1-py3-none-any.whl

Download URL niced_url_request-0.1-py3-none-any.whl
Size 6.1 kB
Tags Python 3
SHA-256 checksum
How to use checksums
ee8c670bbf8b4d25cbf99e3e57f3737b4c0efa799ea159fe9172b4e47da19276
BLAKE2b-256 checksum
How to use checksums
29a2ad957e30744afa6f8b8f4805547b8a15cceff0f19222804e13ac6d5fc155
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.2.0 pkginfo/1.5.0.1 requests/2.22.0 setuptools/50.3.0 requests-toolbelt/0.9.1 tqdm/4.48.2 CPython/3.8.2

Release history Release notifications | RSS feed

This release

0.1 This release

2 release files

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