Make standards compatible with HDF5/JSON/XML/YAML.
Project description
mkstd
Make standards that can be exported/imported/validated via HDF5/JSON/XML/YAML.
mkstd
uses pre-existing standards for validation and schema specification, such that files produced using mkstd
can be used independently of mkstd
. For example, a tool developer can use mkstd
to create a standard for their tool's data, but users do not necessarily need mkstd
installed to use the data. However, mkstd
also provides importers and exporters, so intended use also involves an mkstd
installation for convenience.
Installation
pip install mkstd
# For HDF5 support
pip install hdfdict@git+https://github.com/SiggiGue/hdfdict
Intended use
mkstd
is intended to be used at two stages of data management. An example of these stages is provided in .
Generating a standard
At this stage, the "user" is the person designing the data type and corresponding standard. For example, a tool developer who wants to standardize the data produced by their tool. The steps could look like:
- (with
mkstd
) Design the data type as a Pydantic data model. Thanks to Pydantic, it behaves like a standard for your data, as a Python object. - (with
mkstd
) Export the standard as e.g. XML and JSON schemas. - (TODO, with
mkstd
) Generate documentation for the standard, based on the Pydantic data model docstrings.
Using a standard
At this stage, the "user" is someone who wants to use data generated by the tool, or import their own data into the tool.
- (with or without
mkstd
) Reformat data to match the standard specified by the e.g.mkstd
-generated XML or JSON schema. - (with or without
mkstd
) Validate the data against the schema. - (with or without
mkstd
) Import/export the reformatted data with the tool.
External validation
As written above, many uses of the standard produced by mkstd
are intended to be possible without an mkstd
installation. This is because the generated standards are in standardized schema formats. Below are the different formats supported by mkstd
, and how to use/validate standards/data independently of mkstd
.
XML
The XSD format is used. Search the web for validate xml data against schema
.
JSON
The official JSON schema format is used. Search the web for validate json data against schema
.
YAML
Commonly, YAML schemas are actually specified in the same way as JSON schemas. mkstd
does this too. Hence, tools that can validate YAML data against a JSON schema can be used, without an mkstd
installation.
For example, this tool can be used to validate YAML data against a JSON schema, without mkstd
.
pajv validate -s output/mkstd_generated_schema_yaml.json -d output/data.yaml
HDF5
There is currently no standard available for the specification of HDF5 schemas. Hence, the HDF5 files produced by mkstd
can only be validated with mkstd
.
There is a format for HDF5 that enables interconversion with JSON. This is out-of-scope.
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
Built Distribution
File details
Details for the file mkstd-0.0.4.tar.gz
.
File metadata
- Download URL: mkstd-0.0.4.tar.gz
- Upload date:
- Size: 11.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 13efa101164407062515c0434a84a56f95910586aa50d322c18417161ccd9d31 |
|
MD5 | bfef2826cc9a4e84b4ba9ba466703ac3 |
|
BLAKE2b-256 | 01467593b5a754a06f823916e573e328075ad24fb90c5cc0374a5b6db57aaa46 |
File details
Details for the file mkstd-0.0.4-py3-none-any.whl
.
File metadata
- Download URL: mkstd-0.0.4-py3-none-any.whl
- Upload date:
- Size: 15.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.1.1 CPython/3.10.12
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1ec12f65f64b7982d87457c2086ab960be69d658f1d8380542aa9ace3a6208a |
|
MD5 | cc9efeb74193559161d50bf6f938251b |
|
BLAKE2b-256 | 6287fe9eae7415e1d5acbb5229a72898a8a8b16b09eb961475a2380066860aab |