datalad catalog-create
Synopsis
datalad catalog-create [-h] [-c CATALOG] [-m METADATA] [-F CONFIG_FILE] [-f] [--version]
Description
Create a user-friendly web-based data catalog, with or without metadata.
If the catalog does not exist at the specified location, it will be created. If the catalog exists and the force flag is True, this will overwrite assets of the existing catalog, while catalog metadata remain unchanged.
Parameters
- catalogpath-like object | WebCatalog instance
an instance of the catalog to be created
- metadatapath-like object, optional
metadata to be added to the catalog after creation
- forcebool, optional
if True, will overwrite assets of an existing catalog
Yields
- status_dictdict
DataLad result record
Examples
Create a new catalog from scratch:
% datalad catalog-create -c /tmp/my-cat
Create a new catalog at a location where a directory already exists. This will overwrite all catalog content except for metadata.:
% datalad catalog-create -c /tmp/my-cat --force
Create a new catalog and add metadata:
% datalad catalog-create -c /tmp/my-cat -m path/to/metadata.jsonl
Create a new catalog with a custom configuration:
% datalad catalog-create -c /tmp/my-cat -F path/to/custom_config_file.json
Options
-h, --help, --help-np
show this help message. --help-np forcefully disables the use of a pager for displaying the help message
-c CATALOG, --catalog CATALOG
Directory where the catalog is located or will be created.
-m METADATA, --metadata METADATA
The metadata records to be added to the catalog. Multiple input types are possible: - a path to a file containing JSON lines - JSON lines from STDIN - a JSON serialized string.
-F CONFIG_FILE, --config-file CONFIG_FILE
Path to config file in YAML or JSON format. Default config is read from datalad_catalog/config/config.json.
-f, --force
If content for the user interface already exists in the catalog directory, force this content to be overwritten. Content overwritten with this flag include the 'artwork' and 'assets' directories and the 'index.html' and 'config.json' files. Content in the 'metadata' directory remain untouched.
--version
show the module and its version which provides the command