skip to navigation
skip to content

polished 0.0.3

Generates screenshots of a website based on git history

Latest Version: 0.0.15


[![Polished example video](](

The goal of polished is to show the awesome progression and amount of tweaks that go into any website. My [resume](
is a good example, dozens of hours of work and tweaking to come up with this pretty basic final product. Showing that
blood, sweat and hilarious tears in between should be pretty entertaining. Watch pages undulate, stretch, break,
grow, and shrink into place.

### How does it work?

Once you've installed polished, it works like this:

1. Fires up selected backend (for example, PelicanBackend if you use the [Pelican]() blog site generator)
2. Get the history of your git repo
3. Iterate through that history, preparing each page and finally screen cap it

Getting started

### Installing


1. Mac/Linux
1. NodeJS
2. PhantomJS
3. ffmpeg


> pip install polished

### Usage

For a static website with no .html generation needed and `index.html` is in the same dir:

> polished

For a static website with `index.html` in another location

> polished "some/path/to/index.html"

For a pelican blog:

> polished "output/index.html" --backend polished.backends.pelican.PelicanBackend

### Configuring behavior

The default backend is `SimpleBackend` which (with no path specified) looks for "index.html" in current directory and
expects static html without any steps needed to generate the page. This default setup probably doesn't work for most setups.

To expand the behavior, call `polished --backend my.backend.Backend`

### Basic available backends


The most basic backend, assumes no steps are needed to generate HTML.


For the Pelican blogging system, calls `make html` between builds.


For the Django framework, calls "syncdb --migrate"

## Custom backend

Generally, on a simple website these backends will care of you, however you may have to
inherit them and add custom behavior

import polished
import subprocess

class SomeWeirdBehaviorRequired(polished.backends.pelican):
def prepare(self):
Prepare your general stuff here! Generate HTML, setup static files, etc.

def cleanup(self):
Clean up after yourself, delete static files if you need to

@polish(image=15, html="output/pages/about.html")
def fix_broken_import(self):
So you committed some broken img reference that is breaking image #15 (generally polished/00015.polished.png)
all_a_tags = html.cssselect('a')
for a in all_a_tags:
a.attrib["href"] = "some_other_url/%s" % a.attrib["href"]

@polish(between_shas=("sha1", "sha2"))

@polish(between_images=(1, 3))



@skip(between_shas=("sha1", "sha2"))

@skip(between_images=(1, 3))



Couldn't have done it without this [screenshot script]( by Aamir Adnan

Thanks [Levi Thomason]( for always hearing, encouraging, and helping me out in all aspects of life  
File Type Py Version Uploaded on Size
polished-0.0.3.tar.gz (md5) Source 2014-04-18 5KB
  • Downloads (All Versions):
  • 18 downloads in the last day
  • 206 downloads in the last week
  • 1078 downloads in the last month