jsonschema2rst


Namejsonschema2rst JSON
Version 0.1.7 PyPI version JSON
download
home_pagehttps://github.com/inspirehep/jsonschema2rst
SummaryParser for yaml/json schemas to rst
upload_time2024-11-22 11:08:22
maintainerNone
docs_urlNone
authorCERN
requires_pythonNone
licenseGPLv2
keywords jsonschema yaml rst parser documentation
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            jsonschema2rst
++++++++++++++

This project aims to parse *JSON schemas* or *YAML* schemas in order to create
RestructuredText documentation.
Using a tool like Sphinx, it is possible to create high readable documentation
from the files generated, which are RST formatted text.

The outcome RST can be customized by defining a blacklist in csv and using a
custom CSS file. that will inherit the Sphinx one. For the latter, an
example is provided.


Usage
-----
To create **RST** files from **JSON schemas** (or **YAML**) run the command:

.. code-block:: bash

    jsonschema2rst input_folder output_folder

This command will take all JSON or YAML files in this path, sub-folders
included, and wll create a new directory - removing it if already exists -
where all parsed RST file will be placed.


Example
-------
Let's assume you run the following command:

.. code-block:: bash

    jsonschema2rst json_folder rst_output_folder

and also let's assume the folder ``json_folder`` contains the file
``url.json``, which contains the following schema:


.. code-block::

    {
        "title": "URL of related document",
        "properties": {
            "description": {
                "type": "string"
            },
            "value": {
                "format": "url",
                "type": "string"
            }
        },
        "type": "object"
    }


As result, *jsonschema2rst* will create a file called ``url.rst`` in
the ``rst_output_folder`` that will contain the following rst code:

.. code-block:: bash

    .. contents:: Table of Contents
    .. section-numbering::
    .. container:: section-title
     url.json

    .. container:: title

     URL of related document

    **type** : ``object``

    **Properties:** description_, value_


    .. description:

    description
    +++++++++++

    **type** : ``string``


    .. value:

    value
    +++++


    **type** : ``string``

    **format** : ``url``



Extra
-----
In case you want to generate HTML documentation using a tool like *Sphinx*, we
suggest you to try the `custom.css` file in the `contribution` folder to make
your schemas documentation looking better. What you need is just replace the 
default css used by Sphinx in the *conf.py* file with the one proposed, then 
enjoy!

            

Raw data

            {
    "_id": null,
    "home_page": "https://github.com/inspirehep/jsonschema2rst",
    "name": "jsonschema2rst",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "jsonschema yaml rst parser documentation",
    "author": "CERN",
    "author_email": "admin@inspirehep.net",
    "download_url": "https://files.pythonhosted.org/packages/75/32/13fa94781a04399b8a18ff3b7fca4309e5854c46266a6e21db7a490b61e6/jsonschema2rst-0.1.7.tar.gz",
    "platform": null,
    "description": "jsonschema2rst\n++++++++++++++\n\nThis project aims to parse *JSON schemas* or *YAML* schemas in order to create\nRestructuredText documentation.\nUsing a tool like Sphinx, it is possible to create high readable documentation\nfrom the files generated, which are RST formatted text.\n\nThe outcome RST can be customized by defining a blacklist in csv and using a\ncustom CSS file. that will inherit the Sphinx one. For the latter, an\nexample is provided.\n\n\nUsage\n-----\nTo create **RST** files from **JSON schemas** (or **YAML**) run the command:\n\n.. code-block:: bash\n\n    jsonschema2rst input_folder output_folder\n\nThis command will take all JSON or YAML files in this path, sub-folders\nincluded, and wll create a new directory - removing it if already exists -\nwhere all parsed RST file will be placed.\n\n\nExample\n-------\nLet's assume you run the following command:\n\n.. code-block:: bash\n\n    jsonschema2rst json_folder rst_output_folder\n\nand also let's assume the folder ``json_folder`` contains the file\n``url.json``, which contains the following schema:\n\n\n.. code-block::\n\n    {\n        \"title\": \"URL of related document\",\n        \"properties\": {\n            \"description\": {\n                \"type\": \"string\"\n            },\n            \"value\": {\n                \"format\": \"url\",\n                \"type\": \"string\"\n            }\n        },\n        \"type\": \"object\"\n    }\n\n\nAs result, *jsonschema2rst* will create a file called ``url.rst`` in\nthe ``rst_output_folder`` that will contain the following rst code:\n\n.. code-block:: bash\n\n    .. contents:: Table of Contents\n    .. section-numbering::\n    .. container:: section-title\n     url.json\n\n    .. container:: title\n\n     URL of related document\n\n    **type** : ``object``\n\n    **Properties:** description_, value_\n\n\n    .. description:\n\n    description\n    +++++++++++\n\n    **type** : ``string``\n\n\n    .. value:\n\n    value\n    +++++\n\n\n    **type** : ``string``\n\n    **format** : ``url``\n\n\n\nExtra\n-----\nIn case you want to generate HTML documentation using a tool like *Sphinx*, we\nsuggest you to try the `custom.css` file in the `contribution` folder to make\nyour schemas documentation looking better. What you need is just replace the \ndefault css used by Sphinx in the *conf.py* file with the one proposed, then \nenjoy!\n",
    "bugtrack_url": null,
    "license": "GPLv2",
    "summary": "Parser for yaml/json schemas to rst",
    "version": "0.1.7",
    "project_urls": {
        "Homepage": "https://github.com/inspirehep/jsonschema2rst"
    },
    "split_keywords": [
        "jsonschema",
        "yaml",
        "rst",
        "parser",
        "documentation"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "4536285bc3137fa751349dceca53855513e121e75a88904a53f4d17f56f987a5",
                "md5": "381f49e3000088f36b0b882308d4f870",
                "sha256": "50c605409711e681679c4e528c0b8d5481f833181e83e7d078dea8083a0d00e8"
            },
            "downloads": -1,
            "filename": "jsonschema2rst-0.1.7-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "381f49e3000088f36b0b882308d4f870",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": null,
            "size": 33268,
            "upload_time": "2024-11-22T11:08:20",
            "upload_time_iso_8601": "2024-11-22T11:08:20.946884Z",
            "url": "https://files.pythonhosted.org/packages/45/36/285bc3137fa751349dceca53855513e121e75a88904a53f4d17f56f987a5/jsonschema2rst-0.1.7-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "753213fa94781a04399b8a18ff3b7fca4309e5854c46266a6e21db7a490b61e6",
                "md5": "992cf8604fe8cecd1e52d6c94b9ee373",
                "sha256": "c443a6a4b4cec9f4785c003274c79878681107261839af2bafb0851e5c2fdbe0"
            },
            "downloads": -1,
            "filename": "jsonschema2rst-0.1.7.tar.gz",
            "has_sig": false,
            "md5_digest": "992cf8604fe8cecd1e52d6c94b9ee373",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 27908,
            "upload_time": "2024-11-22T11:08:22",
            "upload_time_iso_8601": "2024-11-22T11:08:22.071261Z",
            "url": "https://files.pythonhosted.org/packages/75/32/13fa94781a04399b8a18ff3b7fca4309e5854c46266a6e21db7a490b61e6/jsonschema2rst-0.1.7.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-11-22 11:08:22",
    "github": true,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "github_user": "inspirehep",
    "github_project": "jsonschema2rst",
    "travis_ci": false,
    "coveralls": false,
    "github_actions": true,
    "lcname": "jsonschema2rst"
}
        
Elapsed time: 0.49554s