License
MIT
Install
pip install dm-cli==1.7.1

Documentation

Data Modelling CLI Tool PyPi version PyPi downloads Visitors

CLI tool for working with Data Modelling Storage Service

Installing

Note

Requires Python version >= 3.11

Install the tool via pip

$ pip3 install dm-cli

After a successful install, the program 'dm' will be available in your python environment

Usage

Usage: dm [OPTIONS] COMMAND [ARGS]...

Command Line Interface (CLI) tool for working with the Data Modelling Framework. This tool is mainly used to upload data source definitions, models and
entities, and creating RecipeLink-tables.

โ•ญโ”€ Options โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ --force               -f            Force the operation. Overwriting and potentially deleting data.                                                         โ”‚
โ”‚ --url                 -u      TEXT  URL to the Data Modelling Storage Service (DMSS). [default: http://localhost:5000]                                      โ”‚
โ”‚ --token               -t      TEXT  Token for authentication against DMSS. [default: no-token]                                                              โ”‚
โ”‚ --debug               -d            Print stack trace of suppressed exceptions                                                                              โ”‚
โ”‚ --version             -v            Print version and exit                                                                                                  โ”‚
โ”‚ --install-completion                Install completion for the current shell.                                                                               โ”‚
โ”‚ --show-completion                   Show completion for the current shell, to copy it or customize the installation.                                        โ”‚
โ”‚ --help                              Show this message and exit.                                                                                             โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ
โ•ญโ”€ Commands โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฎ
โ”‚ create-lookup              Create a named Ui-/StorageRecipe-lookup-table from all RecipeLinks in a package existing in DMSS (requires admin privileges).    โ”‚
โ”‚ ds                         Import and reset data sources                                                                                                    โ”‚
โ”‚ entities                   Import, delete, or validate entities and/or blueprints                                                                           โ”‚
โ”‚ export                     Export one or more entities.                                                                                                     โ”‚
โ”‚ import-plugin-blueprints   Import blueprints from a plugin into the standard location 'system/Plugins/<plugin-name>'.                                       โ”‚
โ”‚ reset                      Reset all data sources (deletes and re-uploads all packages to DMSS).                                                            โ”‚
โ•ฐโ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ”€โ•ฏ

Tip

For each of the commands listed above, you can run dm <COMMAND> --help to see subcommand-specific help messages, e.g. dm ds import --help or dm pkg --help

Required directory structure

Certain commands expect a specific directory structure, such as the commands dm reset, dm ds init, and dm ds reset. For these commands, the path argument must be the path to a directory with two subdirectories, data_sources and data.

$ tree app
app
โ”œโ”€โ”€ data
  โ””โ”€โ”€ DemoApplicationDataSource
    โ”œโ”€โ”€ instances
โ”‚     โ””โ”€โ”€ demoApplication.json
|     โ””โ”€โ”€ models
|       โ””โ”€โ”€ DemoApplication.json
โ””โ”€โ”€ data_sources
    โ””โ”€โ”€ DemoApplicationDataSource.json

To add meta information to a package (for example to the models root package), a file with name "package.json" can be placed inside the folder.

Supported reference syntax

The CLI tool will understand and resolve the following address formats during import.

# URI - Full absolute path prefixed with protocol
dmss://datasource/package/entity
dmss://datasource/package/subfolder/entity
dmss://datasource/$123-456.attributeName

# Alias - Require dependencies to be defined somewhere in the source tree
ALIAS:package/entity
ALIAS:entity

# Data Source - Relative from the destination data source
/package/entity
/package/subfolder/entity
/$123-456.attributeName

# Package - Relative from the source package
entity
subfolder/entity

# Dotted - Relative from the file (UNIX directory traversal)
./../entity
../subfolder/entity
../../subfolder/entity

Development

$ python3 -m venv .venv
$ source .venv/bin/activate
# Install the package from local files in edit mode (-e)
$ pip3 install -e .
$ dm --help

Testing

  1. Install the dependencies: pip3 install -r requirements.txt
  2. Install the dev dependencies: pip3 install -r dev-requirements.txt
  3. Run the tests: pytest

Feedback

Please feel free to leave feedback in issues/PRs.

Contributing

If you would like to contribute, please read our Contribution guide.