by justquick

justquick / python-varnish

Simple Python interface for the Varnish management port

130 Stars 41 Forks Last release: Not found BSD 3-Clause "New" or "Revised" License 36 Commits 0 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:

Simple Python interface for the Varnish management port

:Author: Justin Quick [email protected], Sandy Walsh [email protected] :Version: 0.2


pip install python-varnish==0.2.1

If you are running a version of varnish older than 3.0 then install python-varnish==0.1.2 instead.

Varnish is a state-of-the-art, high-performance HTTP accelerator. For more information checkout

Varnish Site 

Varnish provides a simple telnet management interface for doing things like:

  • reloading configurations
  • purging URLs from cache
  • view statistics
  • start and stop the server

This Python API takes full advantage of the available commands and can run across multiple Varnish instances. Here are the features of this python module (compared to

  • Uses
    instead of raw sockets
  • Implements
  • Can run commands across multiple Varnish instances
  • More comprehensive methods, closely matching the management API (
    , etc.)
  • Unittests


manager = VarnishManager( ('server1:6082', 'server2:6082') )'ping')'ban.url', '^/secret/$')'ban.list')'purge.url', '*') manager.close()



We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.