Skip to main content

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 importersand 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 .

Standard generation

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:

  1. (with mkstd) Design the data type as a Pydantic data model. Thanks to Pydantic, is behaves like a standard for your data, as a Python object.
  2. (with mkstd) Export the standard as an XML and JSON schemas.
  3. (TODO, with mkstd) Generate documentation for the standard, based on the Pydantic data model docstrings.

Standard use

At this stage, the "user" is someone who wants to use data generated by the tool, or import their own data into the tool.

  1. (with or without mkstd) Reformat data to match the standard specified by the XML or JSON schema.
  2. (with or without mkstd) Validate the data against the schema.
  3. (with or without mkstd) Import/export data in this format with the tool.

External validation

As indicated 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

mkstd-0.0.3.tar.gz (11.7 kB view details)

Uploaded Source

Built Distribution

mkstd-0.0.3-py3-none-any.whl (15.7 kB view details)

Uploaded Python 3

File details

Details for the file mkstd-0.0.3.tar.gz.

File metadata

  • Download URL: mkstd-0.0.3.tar.gz
  • Upload date:
  • Size: 11.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for mkstd-0.0.3.tar.gz
Algorithm Hash digest
SHA256 3b22f1742530b52680b7761e9c0a8fb8bae1aad1fe36f2174516854b7a932fbf
MD5 2e805bb3294666dd2bf894813b353c67
BLAKE2b-256 745834456e3d6cff686296953584fa80ab03ed57c09f77a0e19687b1bbf1ce16

See more details on using hashes here.

File details

Details for the file mkstd-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: mkstd-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 15.7 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for mkstd-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 df6d4344fb3911bc96520049d21de282293d444feb3eb35c2e26e69fcb733311
MD5 41796e24fb563828d210cffba4832559
BLAKE2b-256 a2711a7788d1dc87eb8e820620b90438bfc0f6106054344da8c0c33437892e24

See more details on using hashes here.

Supported by

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