Metpack CLI Commands — Metapack 0.7.11 documentation

# Metpack CLI Commands

## mp: Main program

### mp

Entry program for running Metapack commands.

    usage: mp [-h] [--exceptions] [--debug] [--quiet] [--no-cache] {build,colmap,edit,make,mk,new,s3,stats,touch,update,url,config,doc,index,info,open,run,search,notebook} ...

-h, --help

  show this help message and exit

--exceptions, -e

  Show full stack tract for some unhandled exceptions

--debug, -d

  Turn on debug logging ( Basic Config )

--quiet, -q

  Display less output

--no-cache, -n

  Ignore the download cache

## config: Show Configuration Information

### mp config

    usage: mp config [-h] [-v] [-V] [-c] [-d] [-m] [-t]

-h, --help

  show this help message and exit

-v, --version

  Print Metapack versions

-V, --versions

  Print version of several important packages

-c, --cache

  Print the location of the cache

-d, --declare

  Print the location of the default declarition document

-m, --materialized

  Print the location of the materialized data cache

-t, --value-types

  Print a list of available value types

## doc: Display package documentation

### mp doc

    usage: mp doc [-h] {graph,deps,schema,markdown,html,json,jsonld,yaml} ...

-h, --help

  show this help message and exit

#### mp doc deps

    usage: mp doc deps [-h] [-p] [-f FORMAT] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

-p, --packages

  When listing dependencies, list only packages

-f <format>, --format <format>

  Table format, an argument to tabulate(). Common options are: plain, simple, jira, html, pipe, rst, mediawiki. Use pipe for markdown.

#### mp doc graph

    usage: mp doc graph [-h] [-d] [-v] [-V] [-D DIRECTORY] [-N] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

-d, --dependencies

  List the dependencies

-v, --view

  View doc file after creating it

-V, --graphviz

  Also dump the Graphviz file to the stdout

-D <directory>, --directory <directory>

  Output file name

-N, --nonversion

  Use the nonversioned package name for the file name

#### mp doc html

    usage: mp doc html [-h] [-t TEMPLATE] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

-t <template>, --template <template>

  Set the template.

#### mp doc json

    usage: mp doc json [-h] [-c] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

-c, --contact

  Show only the contact information

#### mp doc jsonld

    usage: mp doc jsonld [-h] [-c] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

-c, --contact

  Show only the contact information

#### mp doc markdown

    usage: mp doc markdown [-h] [-t TEMPLATE] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

-t <template>, --template <template>

  Set the template.

#### mp doc schema

    usage: mp doc schema [-h] [-f FORMAT] [-c COLUMN]

-h, --help

  show this help message and exit

-f <format>, --format <format>

  Table format, an argument to tabulate(). Common options are: plain, simple, jira, html, pipe, rst, mediawiki. Use pipe for markdown.

-c <column>, --column <column>

  Add a column from the schema to the output table. If specified, only the’name’ column is included by default

#### mp doc yaml

    usage: mp doc yaml [-h] [-c] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

-c, --contact

  Show only the contact information

## index: Add a package to the search index

### mp index

Index packages for searching.

The index file is a JSON file, which is by default index.json in the cache. The file can be moved by setting the METAPACK_SEARCH_INDEX environmental variable.

    usage: mp index [-h] [-l] [-c] [-C] [-f FILE] [-w] [-D DUMP] [-L LOAD] [-p PROFILE] [-r] [metatab_url]

metatab_url

  URL to a metatab package or container for packages

-h, --help

  show this help message and exit

-l, --list

  List the packages that would be indexed

-c, --clear

  Clear the index

-C, --config

  Show the location of the index file

-f <file>, --file <file>

  Alternative path to index file

-w, --write

  After creating an index file from S3 and write back the index file

-D <dump>, --dump <dump>

  Dump a Metatab formatted version of the index

-L <load>, --load <load>

  Load in a Metatab formatted index file

-p <profile>, --profile <profile>

  Name of a BOTO or AWS credentials profile, for S3 indexing

-r, --result

  If mp -q flag set, still report results

## info: Show Package information

### mp info

Entry program for running Metapack commands.

    usage: mp info [-h] [-n | -N | -r | -D | -s | -R | -p | -P | -T | -t | -U] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

-n, --name

  Print the name, with version

-N, --root-name

  Print the name, without the version

-r, --resources

  List the resources in the package

-D, --distributions

  Show distribution URLS

-s, --schema

  Print a table of the common schema for all resources, or if the metatab file ref has a resource, only that one

-R, --row-table

  Print the row-processor table, including transforms and valuetypes

-p, --package-url

  Print the package url

-P, --package-root

  Print the package root url

-T, --value-types

  Print a list of available value types

-t, --transforms

  Print a list of available transform functions

-U, --next-update

  Print the date of the next update, based on Root.Modified and Root.UpdateFrequency

## open: Open a resource as a CSV file

### mp open

The mp open command will open a resource with the system application, such as Excel or OpenOffice

    usage: mp open [-h] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

## run: Run a resource to produce data

### mp run

    usage: mp run [-h] [-r RESOURCE | -f REFERENCE] [-c | -t | -j | -y | -T] [-p] [-m] [-R TRUNCATE] [-S SAMPLE] [-L LIMIT] [-N] [-n] [metatabfile]

metatabfile

  Path or URL to a metatab file. If not provided, defaults to ‘metadata.csv’

-h, --help

  show this help message and exit

-r <resource>, --resource <resource>

  Name of the Root.Resource to run

-f <reference>, --reference <reference>

  Name of the Root.Reference to run

-c, --CSV

  Output as CSV

-t, --tabs

  Output as tab-delimited rows

-j, --json

  Output JSON lines. Each line is a completel JSON object

-y, --yaml

  Output YAML

-T, --table

  Output 20 rows in a table format. Truncates columns to width of terminal

-p, --pivot

  When outputting a table, transpose rows for columns

-m, --markdown

  When outputting a table, use Markdown format

-R <truncate>, --truncate <truncate>

  Truncate the width of column values

-S <sample>, --sample <sample>

  Sample values from a column

-L <limit>, --limit <limit>

  Limit the number of output rows

-N, --number

  Add line numbers as the first column

-n, --no-schema

  Don’t use the schema to tansform the data

## search: Search for a package

### mp search

Index packages for searching.

The index file is a JSON file, which is by default index.json in the cache. The file can be moved by setting the METAPACK_SEARCH_INDEX environmental variable.

    usage: mp search [-h] [-l] [-f FORMAT] [-1] [-p] [-c] [-j] [-n] [-r] [search]

search

  Path or URL to a metatab file

-h, --help

  show this help message and exit

-l, --list

  List the packages in the index

-f <format>, --format <format>

  Select a specific package format

-1, --one

  Find only one result, using the same resolution process used when building packages

-p, --path

  Instead of displaying the Metapack URL, display only the local file path

-c, --config

  Show the path to the index file

-j, --json

  Output json for some commands

-n, --name

  Output only the first column, the name of the package

-r, --ref

  Output only the third column, the url of the package