dsw-tdk
Template Development Kit for Data Stewardship Wizard
Installation
Python package
You can easily install this tool using pip (from PyPI):
$ pip install dsw-tdk
Optionally, you can clone any version from this repository and install it directly:
$ git clone https://github.com/ds-wizard/dsw-tdk.git
$ pip install -e .
We recommend using virtual environments to avoid clashes in dependencies with other projects.
Dockerized tool
If you don't want to use Python directly on your machine, you can easily use Docker image with DSW TDK:
$ docker run datastewardshipwizard/dsw-tdk --help
$ docker run datastewardshipwizard/dsw-tdk:develop --help
See datastewardshipwizard/dsw-tdk on Docker Hub to check available tags.
Usage
You can find out possibilities directly using --help flag:
$ dsw-tdk --help
$ dsw-tdk put --help
For further information, visit our documentation.
Basic commands
new= create a new template project locally using interactive wizardlist= list templates available in configured DSW instanceget= download a template from DSW instanceput= upload a template to DSW instance (create or update)verify= check the metadata of local template projectpackage= create a distribution ZIP package that is importable to DSW via web interfacepot= create a POT file with translatable strings of the local template projectget-context= download the document context of a project (--project UUID, optionally--event UUID) or a knowledge model editor (--km-editor UUID), as the server sends it; it prints the ETag, which is the context'shashgenerate-context= generate plausible document contexts from a knowledge model:--sample(shipped with the TDK),--km-bundle FILE,--km-package UUID(from the server) or--from FILE(keeps its knowledge model, package, config and workspace);--profile empty|minimal|typical|full|edge(repeatable) sets how much is filled in,--count Nthe variants per profile,--source project|km-editorthe kind of context,--seedmakes the output reproducible and-D KEY=VALUEsetsconfigvalues. With--from,--mutateperturbs the context at the rate of each profile and--anonymizereplaces its personal data and free text with deterministic placeholders (both can be combined). Every generated context passesvalidate-contextvalidate-context= check document context files against the 19.0 schema and their own knowledge model (reply paths and values, files, labels, phase, version, hash); it prints errors and warnings and exits with1on any error, and--fix-hashrewrites a hash that does not match the contentrender= render documents from the local template project and document contexts (no DSW instance needed)
Rendering documents locally
render uses the same engine as the DSW document worker (dsw-templating). You need a document context (metamodel 19.0) as a JSON file, from get-context or generate-context:
$ dsw-tdk render --context context.json --format "HTML Document" --output document.html
$ dsw-tdk render -c context.json -F "PDF Document" --po cs.po -l cs --project-files ./files
--formataccepts the UUID or name of a format (it can be omitted if the template has only one)- The context must be a complete, valid 19.0 context; otherwise
renderfails with the file, the JSON path and the problem. A context whosehashdoes not match its content (edited by hand) is rendered with a warning renderfillsdocumentas the document worker would:documentTemplate(idandversionfromtemplate.json) andformatare always those being rendered (with a warning if the context names others); the rest is kept from the context, or, fordocument: null, is a preview named after the project or KM editor, without a language, created now-l/--language,--preview/--final,--event UUIDand--document-name NAMEsetdocument.language(and resetsdocument.locale),preview,eventUuidandname--porenders with translations from a PO file (e.g. a translateddsw-tdk potoutput), indocument.language; with-l,document.localeis filled for that language--write-context [FILE]saves the context that was rendered (withdocumentfilled, but without what the worker adds below) toFILE, or to<output-name>.context.json; it passesvalidate-context--project-filesis a directory with files uploaded to the project, named by their UUID or file name- Only files selected by
_tdk.filesare available to the rendering, as on the server - The context is completed as the document worker does it with its default configuration:
configgets the service name and URL of the Data Stewardship Wizard and fallbacks for missing branding (app title, colors, logo), andextrasrequested by the format but missing in the context are rendered as for a document without a project (with a warning) - The worker's defaults can be overridden with
-D NAME=VALUE(repeatable), named as in thedocumentContextsection of the document worker configuration, or with its environment variables (also in.env); the option wins over the environment:
$ dsw-tdk render -c context.json -F "HTML Document" -D "serviceName=FAIR Wizard" -D serviceUrl=https://fair-wizard.com
$ echo 'DOCUMENT_CONTEXT_SERVICE_NAME=FAIR Wizard' >> .env
| Name | Environment variable | Default |
|---|---|---|
serviceName |
DOCUMENT_CONTEXT_SERVICE_NAME |
Data Stewardship Wizard |
serviceNameShort |
DOCUMENT_CONTEXT_SERVICE_NAME_SHORT |
DSW |
serviceUrl |
DOCUMENT_CONTEXT_SERVICE_URL |
https://ds-wizard.org |
serviceDomainName |
DOCUMENT_CONTEXT_SERVICE_DOMAIN_NAME |
ds-wizard.org |
defaultPrimaryColor |
DOCUMENT_CONTEXT_DEFAULT_PRIMARY_COLOR |
#0033aa |
defaultLogoUrl |
DOCUMENT_CONTEXT_DEFAULT_LOGO_URL |
{{clientUrl}}/assets/logo.svg |
defaultAppTitle |
DOCUMENT_CONTEXT_DEFAULT_APP_TITLE |
DS Wizard |
The service* values are always set; the default* ones apply only where the context has no value.
- Steps
weasyprint,excelandrdflib-convert, therequestsglobal and thepandoc-docx-pagebreakpyPandoc filter need optional dependencies:pip install 'dsw-tdk[all]'; WeasyPrint also needs Pango and thepandocstep needs pandoc installed - The
docx-*.luaPandoc filters of the document worker are always available;--pandoc-filters DIRadds more (searched first) and--pandoc-templates DIRprovides templates for thetemplateoption of thepandocstep (orPANDOC_FILTERS/PANDOC_TEMPLATES, as for the worker) - The
secretsandrequestsglobals exist only when configured for the template on the server; locally,--secret NAME=VALUE(repeatable) providessecretsand--allow-requestsprovidesrequests
Rendering many documents
-c can be repeated and accepts directories (every *.json in it, sorted, not recursive); -F can be repeated, or --all-formats renders every format of the template. With more than one context × format combination, --output is a directory (default output) and each document is written as <context-name>[.<format-name>].<extension> (the format part only with more than one format):
$ dsw-tdk generate-context --sample --profile minimal --profile edge -o contexts
$ dsw-tdk render -c contexts --all-formats -o output
output/summary.json lists every combination in the order it was rendered, with context, format, status (ok or error), durationMs, output (relative to the directory) and error. The exit code is 1 if any combination failed. --write-context takes no file name here and writes <document-name>.context.json next to each document.
Environment variables
You can use the following environment variables to avoid repeating CLI options.
DSW_API_URL= URL of the API you want to use; since Wizard 5.0 it is the address of the instance followed by/api, e.g.,https://my.fair-wizard.com/api(not the address of the client itself)- Used when
--api-urlnot specified
- Used when
DSW_API_KEY= API Key of the user authorized to manage document templates- Used when
--api-keynot specified
- Used when
DSW_WORKSPACE= UUID of the workspaceputcreates a new draft in; without it the draft is created for the whole organization (in a multi-workspace instance)- Used when
--workspacenot specified
- Used when
You can also use them in .env file which is automatically loaded from current directory or specify it using --dot-env option:
$ ls -a
. .. .env my-other-file
$ dsw-tdk list
$ dsw-tdk --dot-env /path/to/my/.env list
How to start
- Prepare your DSW instance and admin account (optionally, prepare
.envfile) - Verify the connection by issuing
dsw-tdk list - Create a new template project
dsw-tdk newor get existingdsw-tdk get(or re-use some local) - Go to the template project and make edits you need to do
- Update template in DSW with
dsw-tdk put(or continually withdsw-tdk put --watch) - (or) Create a distribution ZIP package that is importable via DSW web interface with
dsw-tdk package
Verbosity
You can use --quiet and --debug flags to toggle less or more output messages:
$ dsw-tdk --quiet list
$ dsw-tdk --debug list
Requirements
- Python 3.12+
- DSW instance with matching version (e.g. a local one using Docker)
- Admin credentials (email+password) to the DSW instance
Contributing
We welcome any form of feedback and contribution to this tool:
- Report bugs or ask in case of uncertainty using GitHub Issues.
- Share ideas and feature requests using DSW Ideas site.
- Submit enhancements using Pull Requests, just please make sure that you comply with used conventions.
For more information read CONTRIBUTING.
License
This project is licensed under the Apache 2 License - see the LICENSE file for more details.
Metadata
Release files for dsw-tdk 5.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| dsw_tdk-5.0.0.tar.gz | 113.3 kB | With provenance | Details for dsw_tdk-5.0.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| dsw_tdk-5.0.0-py3-none-any.whl | Python 3 | none | any | Details for dsw_tdk-5.0.0-py3-none-any.whl |
Total release size: 190.7 kB
Release files / dsw_tdk-5.0.0.tar.gz
| Download URL | dsw_tdk-5.0.0.tar.gz |
|---|---|
| Size | 113.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
61601c3c4eb036491eca1ae443fdbec9dc2a416aeb18addb20214ca9194889a1
|
|
BLAKE2b-256 checksum How to use checksums |
fe4ad5b65b7c66efb30dbc739ba1c9327bb0f2321d4f482652a9daedb3baf1b4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logRelease files / dsw_tdk-5.0.0-py3-none-any.whl
| Download URL | dsw_tdk-5.0.0-py3-none-any.whl |
|---|---|
| Size | 77.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
169b58e0891745f0c938271f65cecabd3f299dc37924adc1b920187ebc87cb8a
|
|
BLAKE2b-256 checksum How to use checksums |
3fe66cb68984b824b9a2551684b568eb32505ac1f6450efdf8c25aa4af638829
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
Yes |
| Uploaded via |
twine/7.0.0 CPython/3.13.16
|
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logSecurity for dsw-tdk 5.0.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
Full provenance
Both files in this release have been uploaded with provenance metadata.
Attestation for dsw_tdk-5.0.0.tar.gz
PyPI Publish Attestation
PyPI verified that this artifact, at this checksum, originated from the publisher listed below.
Signed by GitHub Actions, verified by PyPI on Nov 5, 2026.
Transparency logA note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.