Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A basic but fast, persistent and threadsafe caching system

Project Description
# A basic but fast, persistent and threadsafe caching system

**Basic commands**

Importing required modules first:

from webscrapetools import urlcaching

Initializing the cache:


The option _expiry_days_ sets the cache expiry period, default is 10 days.

This is a required step: otherwise responses to url calls will simply not be cached.
Cache data are stored in the specified folder, so that re-using the same string makes the cache persistent. This creates
the folder on the fly if it does not exist.
The following command cleans up the cache, making sure we start with no prior data:


Opening an url with the following command stores the repsonse content behind the scene, so that subsequent calls will
not hit the network.


**Full example**

from webscrapetools import urlcaching
import time

# Initializing the cache

# Making sure we start from scratch

# Demo with 5 identical calls... only the first one is delayed, all others are hitting the cache
count_calls = 1
while count_calls <= 5:
start_time = time.time()
duration = time.time() - start_time
print('duration for call {}: {:0.2f}'.format(count_calls, duration))
count_calls += 1

# Cleaning up

The code above outputs the following:

duration for call 1: 6.74
duration for call 2: 0.00
duration for call 3: 0.00
duration for call 4: 0.00
duration for call 5: 0.00

Release History

Release History

This version
History Node


History Node


History Node


History Node


Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
webscrapetools-0.4.0.tar.gz (9.8 kB) Copy SHA256 Checksum SHA256 Source Jul 5, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting