Skip to main content


Project description

A bottle webapp for serving static files from a git branch, or from the local filesystem.


  • [x] Serve static files from a filesystem directory
  • [x] Serve static files from a git branch, with Last-Modified headers according to git timestamps
  • [x] Guess MIME-types from paths
  • [x] subprocess bindings to git cat-file and git show
  • [ ] dulwich
  • [ ] pygit2


Serve /var/www/html from http://localhost:8082/

pgs -p /var/www/html

Serve the gh-pages branch of this repo from http://localhost:8083

pgs -g $VIRTUAL_ENV/src/pgs -r gh-pages -P 8083

Further Usage:

$ pgs --help
Usage: pgs [-p <path>] [-g <repopath>] [-r <rev/tag/branch>]

Serve a directory or a git revision over HTTP with Bottle, WSGI, MIME types,
and Last-Modified headers

  -h, --help            show this help message and exit
                        Path to git repo to serve files from
                        Git repo revision (commit hash, branch, tag)
  -H HOST, --host=HOST
  -P PORT, --port=PORT
  --debug               set bottle debug=False
  --reload              set bottle reload=False
  -v, --verbose
  -q, --quiet
  -t, --test

Caveat Emptor

  • Upstream caching would be necessary for all but the most local use cases
  • True git bindings would likely do less buffering of subprocess.check_output


0.1.1 (2015-04-16)

  • First release on PyPI.

Project details

Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
pgs-0.1.2-py2.py3-none-any.whl (52.4 kB) Copy SHA256 hash SHA256 Wheel py2.py3
pgs-0.1.2.tar.gz (60.0 kB) Copy SHA256 hash SHA256 Source None

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page