mkstd


Namemkstd JSON
Version 0.0.3 PyPI version JSON
download
home_pageNone
SummaryMake standards compatible with HDF5/JSON/XML/YAML.
upload_time2024-08-21 16:39:28
maintainerNone
docs_urlNone
authorNone
requires_python>=3.8
licenseBSD 3-Clause License Copyright (c) 2024, Dilan Pathirana Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. 2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. 3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
keywords standard hdf5 json xml yaml
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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
```bash
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 [](https://github/dilpath/mkstd/examples/libssr/ssr_data.py).
## 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](https://en.wikipedia.org/wiki/XML_Schema_%28W3C%29) is used. Search the web for `validate xml data against schema`.

## JSON
The [official JSON schema](https://en.wikipedia.org/wiki/JSON#Metadata_and_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](https://github.com/json-schema-everywhere/pajv) can be used to validate YAML data against a JSON schema, without `mkstd`.
```bash
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](https://github.com/HDFGroup/hdf5-json). This is out-of-scope.

            

Raw data

            {
    "_id": null,
    "home_page": null,
    "name": "mkstd",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "standard, hdf5, json, xml, yaml",
    "author": null,
    "author_email": "Dilan Pathirana <dilan.pathirana@uni-bonn.de>",
    "download_url": "https://files.pythonhosted.org/packages/74/58/34456e3d6cff686296953584fa80ab03ed57c09f77a0e19687b1bbf1ce16/mkstd-0.0.3.tar.gz",
    "platform": null,
    "description": "# mkstd\nMake standards that can be exported/imported/validated via HDF5/JSON/XML/YAML.\n\n`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.\n\n# Installation\n```bash\npip install mkstd\n\n# For HDF5 support\npip install hdfdict@git+https://github.com/SiggiGue/hdfdict\n```\n\n# Intended use\n`mkstd` is intended to be used at two stages of data management. An example of these stages is provided in [](https://github/dilpath/mkstd/examples/libssr/ssr_data.py).\n## Standard generation\nAt 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:\n1. (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.\n2. (with `mkstd`) Export the standard as an XML and JSON schemas.\n3. (TODO, with `mkstd`) Generate documentation for the standard, based on the Pydantic data model docstrings.\n## Standard use\nAt this stage, the \"user\" is someone who wants to use data generated by the tool, or import their own data into the tool.\n1. (with or without `mkstd`) Reformat data to match the standard specified by the XML or JSON schema.\n2. (with or without `mkstd`) Validate the data against the schema.\n3. (with or without `mkstd`) Import/export data in this format with the tool.\n\n# External validation\nAs 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`.\n\n## XML\nThe [XSD format](https://en.wikipedia.org/wiki/XML_Schema_%28W3C%29) is used. Search the web for `validate xml data against schema`.\n\n## JSON\nThe [official JSON schema](https://en.wikipedia.org/wiki/JSON#Metadata_and_schema) format is used. Search the web for `validate json data against schema`.\n\n## YAML\nCommonly, 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.\n\nFor example, [this tool](https://github.com/json-schema-everywhere/pajv) can be used to validate YAML data against a JSON schema, without `mkstd`.\n```bash\npajv validate -s output/mkstd_generated_schema_yaml.json -d output/data.yaml\n```\n\n## HDF5\nThere is currently no standard available for the specification of HDF5 schemas. Hence, the HDF5 files produced by `mkstd` can only be validated with `mkstd`.\n\nThere is a [format for HDF5 that enables interconversion with JSON](https://github.com/HDFGroup/hdf5-json). This is out-of-scope.\n",
    "bugtrack_url": null,
    "license": "BSD 3-Clause License  Copyright (c) 2024, Dilan Pathirana  Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:  1. Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.  2. Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.  3. Neither the name of the copyright holder nor the names of its contributors may be used to endorse or promote products derived from this software without specific prior written permission.  THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS \"AS IS\" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. ",
    "summary": "Make standards compatible with HDF5/JSON/XML/YAML.",
    "version": "0.0.3",
    "project_urls": {
        "Homepage": "https://github.com/dilpath/mkstd"
    },
    "split_keywords": [
        "standard",
        " hdf5",
        " json",
        " xml",
        " yaml"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "a2711a7788d1dc87eb8e820620b90438bfc0f6106054344da8c0c33437892e24",
                "md5": "41796e24fb563828d210cffba4832559",
                "sha256": "df6d4344fb3911bc96520049d21de282293d444feb3eb35c2e26e69fcb733311"
            },
            "downloads": -1,
            "filename": "mkstd-0.0.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "41796e24fb563828d210cffba4832559",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 15747,
            "upload_time": "2024-08-21T16:39:26",
            "upload_time_iso_8601": "2024-08-21T16:39:26.932649Z",
            "url": "https://files.pythonhosted.org/packages/a2/71/1a7788d1dc87eb8e820620b90438bfc0f6106054344da8c0c33437892e24/mkstd-0.0.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "745834456e3d6cff686296953584fa80ab03ed57c09f77a0e19687b1bbf1ce16",
                "md5": "2e805bb3294666dd2bf894813b353c67",
                "sha256": "3b22f1742530b52680b7761e9c0a8fb8bae1aad1fe36f2174516854b7a932fbf"
            },
            "downloads": -1,
            "filename": "mkstd-0.0.3.tar.gz",
            "has_sig": false,
            "md5_digest": "2e805bb3294666dd2bf894813b353c67",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 11734,
            "upload_time": "2024-08-21T16:39:28",
            "upload_time_iso_8601": "2024-08-21T16:39:28.876270Z",
            "url": "https://files.pythonhosted.org/packages/74/58/34456e3d6cff686296953584fa80ab03ed57c09f77a0e19687b1bbf1ce16/mkstd-0.0.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-08-21 16:39:28",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "dilpath",
    "github_project": "mkstd",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": false,
    "lcname": "mkstd"
}
        
Elapsed time: 1.13549s