skip to navigation
skip to content

Not Logged In

GrabLib 0.05

Utility for defining then downloading, concatenating and minifying your project's external library files

Copyright (C) 2013-2014 Samuel Colvin S@muelColvin.com

Python tool and library for downloading, concatenating and minifying library files (eg. Javascript and CSS) so they don’t clog up your repo.

Definition files can either be JSON or Python (see examples). So the versions of libraries used in your project can be defined in version control without the need for files from external projects.

The formats define the same things, the following values can be set:

  • libs: a dictionary of files to download and locations to put them, zip files may also be defined with multiple files extracted to different locations. If not specified nothing is downloaded.
  • slim: Dictionary defining which files to concatenate and optionally minify using slimit. See examples for details.
  • libs_root: Root directory to put downloaded files in, defaults to the working directory.
  • libs_root_slim: Root directory to put slimmed files in, defaults to libs_root.
  • verbosity: Level 0 (nothing except errors), 1 (a little), 2 (default), 3 (everything).
  • overwrite: bool, whether or not to overwrite files that already exist, default is not to download existing.
  • file_permissions: Explicitly set files’ permissions.
  • sites: Dictionary of site names to generate urls to avoid repeating https://raw.githubusercontent.com lots of times.

All options settings (except sites) can also be overwritten at the command line, in python format or using the API a special output function may also be defined.

You can also call GrabLib from inside python:

import GrabLib
GrabLib.process_file('path/to/definitions.json|py')

# or with options overridden

op_overide = GrabLib.EMPTY_OPTIONS
op_overide['verbosity'] = 3
GrabLib.process_file('path/to/definitions.json|py', op_overide)

Package available on pip, source available on github.

 
File Type Py Version Uploaded on Size
GrabLib-0.05.tar.gz (md5) Source 2014-07-15 6KB
  • Downloads (All Versions):
  • 4 downloads in the last day
  • 65 downloads in the last week
  • 318 downloads in the last month