skip to navigation
skip to content

cassette 0.3.8

Cassette stores and replays HTTP requests.

Cassette stores and replays HTTP requests made in your Python app.

import urllib2

import cassette


    # If the request is not already stored in responses.yaml, cassette
    # will request the URL and store its response in the file.
    r = urllib2.urlopen("")

    # This time, the request response must be in the file. The external
    # request is not made. cassette retrieves the response from the
    # file.
    r = urllib2.urlopen("")

assert "A.ROOT-SERVERS.NET" in

Cassette also supports the requests library.

import requests

    r = requests.get("")

Note that requests stored between different libraries may not be compatible with each other. That is, a request stored with urllib2 might still trigger an external request is the same URL is requested with requests.


$ pip install cassette


Latest documentation:


cassette is available under the MIT License.

Copyright Uber 2013, Charles-Axel Dein <>

File Type Py Version Uploaded on Size (md5) Source 2015-04-03 24KB