From 80d33a52403f0fa92acfe9e6c07784071b2e441f Mon Sep 17 00:00:00 2001 From: SteffRhes Date: Thu, 19 Dec 2024 08:45:52 +0100 Subject: [PATCH] finalize v24.12.19 --- README.md | 6 +++--- README_pypi.md | 38 ++++++++++++++++++++++++++++++++++++++ setup.py | 4 ++-- 3 files changed, 43 insertions(+), 5 deletions(-) create mode 100644 README_pypi.md diff --git a/README.md b/README.md index 34f6a56..dc8e265 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # VELD spec -**version v24.12.18** +**version v24.12.19** This is the formal specification of the VELD metadata schema. @@ -515,8 +515,8 @@ additional: #### \ To configure a code veld's behaviour, variables can be set. This section serves as a -contxtualization on the `` and `` sections. With ``, -`environment` refers to the variable name, `description` explains the variable's purpose and +contxtualization on the `` section. Within ``, +`environment_var` refers to the variable name, `description` explains the variable's purpose and functionality, `var_type` the type, `default` any default value (which should be set in code veld's docker compose definition at `environment`), `optional` whether this variable is optional. diff --git a/README_pypi.md b/README_pypi.md new file mode 100644 index 0000000..6ce956a --- /dev/null +++ b/README_pypi.md @@ -0,0 +1,38 @@ + +This package contains the validator for the VELD metadata schema. + +For the specification of the schema, see here: https://github.com/acdh-oeaw/VELD_spec + +### how to use the validator + +import with: + +``` +from veld_spec import validate +``` + +Use it to validate veld yaml files, either by passing the content as python dictionary or by passing +the name of a yaml file: + +``` +validate(dict_to_validate={"x-veld": {...}}) +``` + +``` +validate(yaml_to_validate="veld_file.yaml") +``` + +It will return a tuple which: + +- if the veld yaml content is valid, the first element is `True` and the second `None` + +``` +(True, None) +``` + +- if the veld yaml content is invalid, the first element is `False` and the second contains the + error message. + +``` +(False, 'root node x-veld missing') +``` \ No newline at end of file diff --git a/setup.py b/setup.py index 72e72e5..a3c7911 100644 --- a/setup.py +++ b/setup.py @@ -2,11 +2,11 @@ setup( name="veld_spec", - version="24.12.18", + version="24.12.19", author="Stefan Resch", author_email="stefan.resch@oeaw.ac.at", description="VELD specification", - long_description=open("README.md").read(), + long_description=open("README_pypi.md").read(), long_description_content_type="text/markdown", url="https://github.com/acdh-oeaw/VELD_spec", classifiers=[