Skip to main content

Build forms from LinkML. Export to HTML or (basic) PDF

Project description

LinkML formbuilder

© Amsterdam UMC, 2024

This CLI tool converts LinkML models into HTML and PDF forms. It does not check for model validity and thus might crash or show errors when used with an invalid model. Use the official LinkML tools to check whether your model is valid.

This tool was built as part of a larger project by a programmer who is not part of the LinkML development team. Therefore, errors in the interpretation of slots of the modelling language are possible.

Installation

Under the hood, this tool uses the python adaptation of PDFKIT. It requires wkhtmltopdf to be installed on your system.

Installation steps:

  1. Install and add wkhtmltopath
    1. Download here
    2. Add the /bin to the path variable in your system's environment variables
  2. pip install linkmlformbuilder

Build from source

  1. Make sure the working directory contains the pyproject.toml file
  2. pip install build
  3. python -m build
  4. Install the .whl file in the dist folder using pip install

Usage

Basic usage

Without additional arguments, the command linkmlformbuilder [yamlfile] with [yamlfile] being an absolute or relative path to the LinkML yaml resource you want converted, processes the provided LinkML model and creates two files:

  1. An HTML file containing code for PDFKIT to use. This HTML file can be viewed, but will look different than the PDF file. This is due to a missing css file that is added during the PDF conversion
  2. A PDF form based on the provided LinkML model

Advanced usage

usage: linkmlformbuilder [-h] [-html] [-dir [OUTPUT_DIRECTORY]] [--name [NAME]]
                    yamlfile

positional arguments:
  yamlfile              The LinkML yaml file for which a form should be built

optional arguments:
  -h, --help            show this help message and exit
  -html, --html_only    This flag is used when the user only wants an HTML
                        file returned, there will be no PDF export
  -dir [OUTPUT_DIRECTORY], --output_directory [OUTPUT_DIRECTORY]
                        Specify an output directory, the current working
                        directory is used when this value not provided or the
                        flag is missing
  --name [NAME]         Specify an alternative file name, do not specify a
                        file extension. By default, the filename of the
                        yamlfile is used for the HTML and optionally PDF files

Changelog

Version 0.1.1 - Version 0.1.2

Fix entry point

Version 0.1.0

Initial commit

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

linkmlformbuilder-0.1.2.tar.gz (40.7 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

linkmlformbuilder-0.1.2-py3-none-any.whl (43.3 kB view details)

Uploaded Python 3

File details

Details for the file linkmlformbuilder-0.1.2.tar.gz.

File metadata

  • Download URL: linkmlformbuilder-0.1.2.tar.gz
  • Upload date:
  • Size: 40.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.8.10

File hashes

Hashes for linkmlformbuilder-0.1.2.tar.gz
Algorithm Hash digest
SHA256 c8a1f333462842a5e9fadd41fba81a2df07269ebb554a3670d6e21933cf963fd
MD5 67eab2d31a6568e2b0ae78a5c7f7a7b1
BLAKE2b-256 ff34539dffb419c0d2bdf4f422fb4b3930702b7d35e36d8cb13a496076990b9e

See more details on using hashes here.

File details

Details for the file linkmlformbuilder-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for linkmlformbuilder-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 4cd5921369525698ec9daaf0ae9a4cd4011f2a2262a72b7c59dddc04d98cce8c
MD5 1b0e19729d60dce399615bf5d1cfd3b6
BLAKE2b-256 75df082fd7d6da2d19f22398c6805704acf9ef14559f0375d77e86b03700feb9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page