|
| 1 | +[](https://badge.fury.io/py/dsp-tools) |
| 2 | + |
| 3 | +## Installation |
| 4 | + |
| 5 | +To install the latest version run: |
| 6 | + |
| 7 | +``` |
| 8 | +pip3 install dsp-tools |
| 9 | +``` |
| 10 | + |
| 11 | +To update to the latest version run: |
| 12 | + |
| 13 | +``` |
| 14 | +pip3 install --upgrade dsp-tools |
| 15 | +``` |
| 16 | + |
| 17 | +## Create a data model on a DSP server |
| 18 | + |
| 19 | +```bash |
| 20 | +dsp-tools create [options] data_model_definition.json |
| 21 | +``` |
| 22 | + |
| 23 | +The following options are available: |
| 24 | + |
| 25 | +- `-s` | `--server` _server_: URL of the DSP server (default: localhost:3333) |
| 26 | +- `-u` | `--user` _username_: username used for authentication with the DSP API (default: root@example.com) |
| 27 | +- `-p` | `--password` _password_: password used for authentication with the DSP API (default: test) |
| 28 | +- `-V` | `--validate`: If set, only the validation of the JSON file is performed. |
| 29 | +- `-l` | `--lists`: If set, only the lists are created using a [simplified schema](./dsp-tools-create.md#lists). Please note |
| 30 | + that in this case the project must already exist. |
| 31 | +- `-v` | `--verbose`: If set, some information about the progress is printed to the console. |
| 32 | + |
| 33 | +The command is used to read the definition of a data model (provided in a JSON file) and create it on the |
| 34 | +DSP server. The following example shows how to load the ontology defined in `data_model_definition.json` onto the DSP |
| 35 | +server `https://api.dsl.server.org` provided with the `-s` option. The username `root@example.com` and the password |
| 36 | + `test` are used. |
| 37 | + |
| 38 | +```bash |
| 39 | +dsp-tools create -s https://api.dsl.server.org -u root@example.com -p test data_model_definition.json |
| 40 | +``` |
| 41 | + |
| 42 | +The description of the expected JSON format can be found [here](./dsp-tools-create.md). |
| 43 | + |
| 44 | +## Get a data model from a DSP server |
| 45 | + |
| 46 | +```bash |
| 47 | +dsp-tools get [options] output_file.json |
| 48 | +``` |
| 49 | + |
| 50 | +The following options are available: |
| 51 | + |
| 52 | +- `-s` | `--server` _server_: URL of the DSP server (default: localhost:3333) |
| 53 | +- `-u` | `--user` _username_: username used for authentication with the DSP API (default: root@example.com) |
| 54 | +- `-p` | `--password` _password_: password used for authentication with the DSP API (default: test) |
| 55 | +- `-P` | `--project` _shortcode_ | _shortname_ | _iri_: shortcode, shortname or |
| 56 | + [IRI](https://en.wikipedia.org/wiki/Internationalized_Resource_Identifier) of the project |
| 57 | +- `-v` | `--verbose`: If set, some information about the progress is printed to the console. |
| 58 | + |
| 59 | +The command is used to get the definition of a data model from a DSP server and write it into a JSON file. This JSON file |
| 60 | +could then be used to upload the data model to another DSP server. The following example shows how to get the data model |
| 61 | +from a DSP server `https://api.dsl.server.org` provided with the `-s` option. The username `root@example.com` and the |
| 62 | +password `test` are used. The data model is saved into the output file `output_file.json`. |
| 63 | + |
| 64 | +```bash |
| 65 | +dsp-tools get -s https://api.dsl.server.org -u root@example.com -p test output_file.json |
| 66 | +``` |
| 67 | + |
| 68 | +## Upload data to a DSP server |
| 69 | + |
| 70 | +```bash |
| 71 | +dsp-tools xmlupload [options] xml_data_file.xml |
| 72 | +``` |
| 73 | + |
| 74 | +The following options are available: |
| 75 | + |
| 76 | +- `-s` | `--server` _server_: URL of the DSP server (default: localhost:3333) |
| 77 | +- `-u` | `--user` _username_: username used for authentication with the DSP API (default: root@example.com) |
| 78 | +- `-p` | `--password` _password_: password used for authentication with the DSP API (default: test) |
| 79 | +- `-i` | `--imgdir` _dirpath_: path to the directory where the bitstream objects are stored (default: .) |
| 80 | +- `-S` | `--sipi` _SIPIserver_: URL of the SIPI IIIF server (default: http://0.0.0.0:1024) |
| 81 | + |
| 82 | +The command is used to upload data defined in an XML file onto a DSP server. The following example shows how to upload |
| 83 | +data from an XML file `xml_data_file.xml` onto the DSP server `https://api.dsl.server.org` provided with the `-s` option. |
| 84 | +The username `root@example.com` and the password `test` are used. The interface for the SIPI IIIF server is provided |
| 85 | +with the `-S` option (`https://iiif.dsl.server.org`). |
| 86 | + |
| 87 | +```bash |
| 88 | +dsp-tools xmlupload -s https://api.dsl.server.org -u root@example.com -p test -S https://iiif.dsl.server.org xml_data_file.xml |
| 89 | +``` |
| 90 | + |
| 91 | +The description of the expected XML format can be found [here](./dsp-tools-xmlupload.md). |
| 92 | + |
| 93 | +## Convert an Excel file into a JSON file that is compatible with dsp-tools |
| 94 | + |
| 95 | +```bash |
| 96 | +dsp-tools excel [options] excel_file.xlsx output_file.json |
| 97 | +``` |
| 98 | + |
| 99 | +The following options are available: |
| 100 | + |
| 101 | +- `-S` | `--sheet` _sheetname_: name of the Excel worksheet to use (default: Tabelle1) |
| 102 | +- `-s` | `--shortcode` _shortcode_: shortcode of the project (required) |
| 103 | +- `-l` | `--listname` _listname_: name to be used for the list and the list definition file (required) |
| 104 | +- `-L` | `--label` _label_: label to be used for the list (required) |
| 105 | +- `-x` | `--lang` _lang_: language used for the list labels and commentaries (default: en) |
| 106 | +- `-v` | `--verbose`: If set, some information about the progress is printed to the console. |
| 107 | + |
| 108 | +The description of the expected Excel format can be found [here](./dsp-tools-create.md#lists-from-excel). |
0 commit comments