Command Line Tools

From Creative Commons
(Redirected from CmdLineTools)
Jump to: navigation, search


The CC Command Line Interface Tools (CLI Tools) are a set of Python scripts which can be used to insert or read license information from the command line. The basic scripts are stored in the cli-tools module in Berlios SVN.

These tools currently lag behind CcLookup in functionality. They will be updated when the libraries for CcLookup stabilize.

Getting the CLI Tools From Subversion

The primary tool scripts are stored in the cli-tools module in Berlios SVN. To check out a working copy of the trunk from anonymous SVN into a directory named cli-tools, issue the following command (Linux or Mac OS X):

 $ svn checkout svn://svn.berlios.de/cctools/cli-tools/trunk cli-tools

That's it; you're all set.

Building the Tools

The CC CLI Tools are written in Python, and utilize zc.buildout for the build process. Starting with the Python interpreter, the Subversion checkout can download and build the necessary dependencies. To start the buildout process, you need to bootstrap your installation:

 $ cd cli-tools
 $ python bootstrap/bootstrap.py

The bootstrap script will download zc.buildout and setuptools, which are required to complete the build process. After you have bootstrapped your checkout, you can build the software:

 $ ./bin/buildout

The buildout process will grab Python Eggs for the software dependencies. The scripts will be placed in the ./bin subdirectory. Note that these scripts will contain absolute paths to the dependency eggs.

Using the CLI Tools

This page describes how to use the current command line interface tools. This page assumes you've already checked out and built the tools as described above.

cct

cct is used to embed a license claim in a file and generate the cooresponding license RDF. Currently MP3 is the only supported format. Running cct with the --help flag will show a simple help screen:

$ ./bin/cct --help
usage: cct [options] filenames 
options:
  -o HOLDER, --holder=HOLDER
                        The copyright holder for the files
  -y YEAR, --year=YEAR  The copyright year for the files
  -l LICENSE, --license=LICENSE
                        URL of the embedded license
  -v VALIDATION, --validation=VALIDATION
                        Validation URL for this file
  --version             show program's version number and exit
  -h, --help            show this help message and exit

ccl

ccl is used to examine a license claim embedded in a file. If a verification URL is specified, ccl.py will attempt to verify the license claim. Currently MP3 is the only supported format. Running ccl with the --help flag will show a simple help screen:

$ ./bin/ccl --help
usage: ccl [options] filenames
options:
  -d, --display  Display the license claim; do not verify.
  --version      show program's version number and exit
  -h, --help     show this help message and exit

claim

claim is used to embed a license claim in a file. Unlike cct, claim does not generate verification RDF, and takes a fully formed TCOP statement instead of the pieces needed to generate one. Currently MP3 is the only supported format. Running claim with the --help flag will show a simple help screen:

$ python claim --help
usage: claim [options] filenames
options:
  -t TCOP, --tcop=TCOP  Complete copyright statement to embed.
  --version             show program's version number and exit
  -h, --help            show this help message and exit