Utility for defining then downloading and preprocessing external static files.
Project description
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",
"sites":
{
"github": "https://raw.githubusercontent.com",
"typeahead": "{{ github }}/twitter/typeahead.js/v0.10.2/dist"
},
"libs":
{
"{{ 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",
"minify":
{
"typeahead_combined.min.js": [".*/ta_raw/.*"]
}
}
Then download and minify you static files with just:
grablib
Library Usage
You can also call grablib from python:
import grablib
grablib.grab('path/to/definitions.json|yml')
# or with options overridden
grablib.grab('path/to/definitions.json|yml', overwrite=True)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
grablib-0.2.tar.gz
(8.1 kB
view hashes)
Built Distribution
grablib-0.2-py2.py3-none-any.whl
(12.1 kB
view hashes)
Close
Hashes for grablib-0.2-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 594f335ab55d1e94c6a6035405bc3363b32199c057d19cb7d40448f6d1aadd49 |
|
MD5 | 4f83358a735ef7b5c83d800d8e29d570 |
|
BLAKE2b-256 | a73d3a5e7e8a2e2b1bbf7494ef50447014a68b8642f808b20178dec9067f1eae |