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

Simple Python interface for the Varnish management port

Project Description
pip install python-varnish==0.2.2

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 python-varnishadm)

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

Example:

manager = VarnishManager(('server1:6082', 'server2:6082'), 'secret_file_content')
manager.run('ping')
manager.run('ban.url ^/articles/$')
manager.run('ban.list')
manager.run('purge.url', 'http://mydomain.com/articles/.*')
manager.close()

Testing:

python runtests.py
Release History

Release History

This version
History Node

0.2.2

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
python_varnishadm-0.2.2-py2-none-any.whl (8.1 kB) Copy SHA256 Checksum SHA256 py2 Wheel Aug 11, 2016
python-varnishadm-0.2.2.tar.gz (6.7 kB) Copy SHA256 Checksum SHA256 Source Aug 11, 2016

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