skip to navigation
skip to content

Not Logged In

polished 0.0.15

Generates screenshots of a website based on git history


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.

More explanation available [on my blog]

### How does polished work?

1. Fires up selected backend *(for example, PelicanBackend if you use the [Pelican] blog site generator)*
2. Gets the git revision history
3. Iterates through that history, prepares the page, screen caps it
4. Converts images to video
5. OPTIONALLY: If after reviewing the images/video you find bugs, inherit a backend and `@polish` out the kinks so it's a nice smooth video

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

To expand the behavior, call `polished my/output/index.html --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 screenshots.



For the Django framework, calls `python 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

from polished.backends import PelicanBackend

class SomeWeirdBehaviorRequired(PelicanBackend):
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

## Polishing certain commits

Use the `@polish` decorator:

from import By
from import WebDriverWait
from import expected_conditions as EC

from polished.backends import PelicanBackend
from polished.decorators import polish

class SomeWeirdBehaviorRequired(PelicanBackend):
def _patch_image_srcs(self):
wait = WebDriverWait(self.DRIVER, 10)
element = wait.until(EC.visibility_of_element_located((By.TAG_NAME, 'img')))

var img_array = document.getElementsByTagName('img');

for(var i=0; i  
File Type Py Version Uploaded on Size
polished-0.0.15.tar.gz (md5) Source 2014-05-19 9KB
  • Downloads (All Versions):
  • 4 downloads in the last day
  • 184 downloads in the last week
  • 267 downloads in the last month