`Index </index.txt>`_

====================
``cssutils`` scripts
====================
:version: $Id: scripts.txt 1230 2008-05-19 20:04:26Z cthedot $

.. contents::

CSSCapture
==========
csscapture.py which is part of the main cssutils package but also installed as a standalone script does include class CSSCapture which downloads all referenced CSS stylesheets of a given URL and saves them to a given target directory.

The complete options of csscapture.py are:

usage: csscapture.py [options] URL

Options:
  -h, --help            show this help message and exit
  -d, --debug           show debug messages during capturing
  -m, --minified        saves minified version of captured files
  -n, --notsave         if given files are NOT saved, only log is written
  -r, --saveraw         if given saves raw css otherwise cssutils' parsed
                        files
  -s SAVETO, --saveto=SAVETO
                        saving retrieved files to "saveto", defaults to
                        "_CSSCapture_SAVED"
  -u UA, --useragent=UA
                        useragent to use for request of URL, default is
                        urllib2s default


CSSCombine
==========
csscombine.py may be used to combine several sheets loaded from a main sheet via @import rules. No nested @imports are resolved yet and @namespace rules do not work yet!

The resulting combined sheet (optionally minified) is send to stdout, info and error messages are send to stderr.

CSSCombine may also be used to change the encoding of the stylesheet if the target encoding is given.

Usage: csscombine.py [options] URL

Options:
  -h, --help            show this help message and exit
  -s SOURCEENCODING, --sourceencoding=SOURCEENCODING
                        encoding of input, defaulting to "css". If given
                        overwrites other encoding information like @charset
                        declarations
  -t TARGETENCODING, --targetencoding=TARGETENCODING
                        encoding of output, defaulting to "UTF-8"
  -m, --minify          saves minified version of combined files, defaults to
                        False

CSSParse
========
Script version of ``cssutils.parseString()`` and ``cssutils.parseFile()``.