Skip to main content

Each Downloader maintains an sqlite3-based disk cache that utilizes zlib compression. Network requests are only made if the cached version of the resource has an age larger or equal to the stale_after value provided by the programmer.

Between network requests a throttling interval needs to elapse. This throttling interval is randomly chosen, but lies within the throttle_bounds defined by the programmer.

HTML resources can be parsed using lxml and in this case an lxml ElementTree is returned instead of a file object, with the links rewritten to be absolute in order to facilitate following them. The parsing is done leniently in order to not fail when invalid HTML is encountered.

The programmer can also supply a function that decides whether the server has banned the client (possibly by examining the returned resource). In this case an exception will be raised.

Downloader’s features make it ideal for writing scrapers, as it can keep its network footprint small (due to the cache) and irregular (due to the random throttling interval).

To install, simply run:

python setup.py install

For documentation, after installing, run:

python -m pydoc downloader

Metadata

Release files for downloader 0.98

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

Source distribution (sdist)

Source distribution for downloader 0.98
File Size Uploaded
downloader-0.98.tar.gz 6.9 kB Details

Release files / downloader-0.98.tar.gz

Download URL downloader-0.98.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
b094e8ed589d7a24b0eeab9e6c1e2638446d82a118fd62cb0c67cccf99a437a9
BLAKE2b-256 checksum
How to use checksums
4eee78bff07448dbf9fd03e45f3ec40ab09a4e0f1827508124b98f3c83d49af4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release history Release notifications | RSS feed

This release

0.98 This release

1 release file

0.96

2 release files

0.95

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