skip to navigation
skip to content

grablib 0.2.1

Utility for defining then downloading and preprocessing external static files.

Copyright (C) 2013-2016 Samuel Colvin

Python tool and library for downloading, preprocessing external static files. You can think of it a bit like bower+ for python.

Minification works with both javascript via jsmin and css via csscompressor.

Definition files can either be JSON or YAML (see examples).

CLI Usage

Define your static files thus: (grablib.json)

  "download_root": "static_files",
    "github": "",
    "typeahead": "{{ github }}/twitter/typeahead.js/v0.10.2/dist"
    "{{ typeahead }}/typeahead.jquery.js": "js/ta_raw/{{ filename }}",
    "{{ typeahead }}/bloodhound.js": "js/ta_raw/{{ filename }}",
    "{{ github }}/twbs/bootstrap/v3.3.5/dist/css/bootstrap.min.css": "{{ filename }}",
    "{{ github }}/twbs/bootstrap/v3.3.5/dist/js/bootstrap.min.js": "{{ filename }}"
  "minified_root": "static_files/minified",
    "typeahead_combined.min.js": [".*/ta_raw/.*"]

Then download and minify you static files with just:


Library Usage

You can also call grablib from python:

import grablib


# or with options overridden
grablib.grab('path/to/definitions.json|yml', overwrite=True)
File Type Py Version Uploaded on Size
grablib-0.2.1-py2.py3-none-any.whl (md5) Python Wheel 2.7 2016-05-18 11KB
grablib-0.2.1.tar.gz (md5) Source 2016-05-18 7KB