Template Development Kit#
Note
Requirements for Local Template Development
Your favorite text editor or IDE
Template Development Kit (see below)
DSW instance (recommended to have local one) with your admin account
Python 3.7+ (with pip) or Docker
Our Template Development Kit (TDK) provides a simple way how to work with templates locally. It is a CLI tool written in Python.
Video Tutorial#
This is a comprehensive video tutorial on how to use the Template Development Kit.
Installation#
You can install it easily using pip from Python Package Index (PyPI). Optionally, you can use virtual environment or other installation option described in the TDK repository.
pip install dsw-tdk
dsw-tdk --help
It is also possible to use datastewardshipwizard/dsw-tdk Docker image when you don’t have Python locally:
docker run datastewardshipwizard/dsw-tdk --help
Commands#
There are these basic commands:
new
= create a new template project, it launches a simple interactive wizard for template metadatalist
= list all templates (latest versions) from configured DSWget
= download a template project with specified template ID from DSWput
= upload the local template project to DSW (once or continually on-change when--watch
flag is used)verify
= check the metadata of the local template projectpackage
= create a ZIP distribution package from the local template project (ZIP is importable to DSW via its web interface)
Default template directory is current one for put
, verify
, and package
. But new
and get
will create a new folder according to the template ID if not explicitly set in other way.
You can use --help
to find out details:
dsw-tdk new --help
Environment variables and .env file#
To avoid entering API URL and credentials every time, you can use environment variables:
DSW_API
= URL of DSW API with which you want to communicate. Hover mouse over your profile name to find the About section where URL is specified.DSW_USERNAME
= your login (email address) to that DSW instance, must be administrator accountDSW_PASSWORD
= corresponding password
To make this even easier, you can store those in .env
file in the project root and it will be loaded automatically. Or you can specify the path to a .env
file:
dsw-tdk --dot-env /path/to/.env list