{"id":15372295,"url":"https://github.com/reorx/json_include","last_synced_at":"2025-10-07T12:41:50.279Z","repository":{"id":31175161,"uuid":"34735594","full_name":"reorx/json_include","owner":"reorx","description":"An extension for JSON to support file including","archived":false,"fork":false,"pushed_at":"2020-06-10T15:39:07.000Z","size":12,"stargazers_count":3,"open_issues_count":5,"forks_count":14,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-04-15T14:46:51.414Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/reorx.png","metadata":{"files":{"readme":"README.rst","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2015-04-28T14:31:03.000Z","updated_at":"2020-12-06T01:07:28.000Z","dependencies_parsed_at":"2022-08-29T03:01:28.726Z","dependency_job_id":null,"html_url":"https://github.com/reorx/json_include","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/reorx/json_include","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reorx%2Fjson_include","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reorx%2Fjson_include/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reorx%2Fjson_include/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reorx%2Fjson_include/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/reorx","download_url":"https://codeload.github.com/reorx/json_include/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/reorx%2Fjson_include/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":262313481,"owners_count":23292141,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-10-01T13:50:03.914Z","updated_at":"2025-10-07T12:41:45.253Z","avatar_url":"https://github.com/reorx.png","language":"Python","readme":"An extension for JSON to support file inclusion\n===============================================\n\njson-include is an extended way for JSON to support file inclusion, it has two parts:\n\n1. A syntax definition called **include syntax**.\n\n2. A Python implementation to parse and build JSON file that contains **include syntax**.\n\n\nSyntax\n------\n\njson-include supports an extended syntax called **include syntax** in JSON,\nformatted as:\n\n.. code-block:: json\n\n    {\n        \"...\": \"\u003cjson file name\u003e\"\n    }\n\nThe include syntax means that this object (the whole ``{\"...\": \"\u003cjson file name\u003e\"}``) in JSON\nis a reference to the JSON file named in ``\u003cjson file name\u003e`` notation,\nand should be included into its place.\n\nThe included JSON should always be an object (dict) rather than an array (list),\nto prevent implicit meaning and make sure we can get a clear view of the structure\nwithout looking into the included JSON files.\n\nIn a normal JSON when we want to include another JSON on an attribute, it should\nbe written as follows:\n\n.. code-block:: json\n\n    {\n        \"username\": \"alice\",\n        \"profile\": {\n            \"...\": \"\u003cprofile_model.json\u003e\"\n        }\n    }\n\nIn this JSON a ``profile_model.json`` is included to present ``profile`` attribute,\nif the content of ``profile_model.json`` is like:\n\n.. code-block:: json\n\n    {\n        \"age\": 18,\n        \"gender\": \"female\"\n    }\n\nthen what we mean by the include syntax is that, when this JSON is being used\nas a normal JSON, it should be seen as:\n\n.. code-block:: json\n\n    {\n        \"username\": \"alice\",\n        \"profile\": {\n            \"age\": 18,\n            \"gender\": \"female\"\n        }\n    }\n\nTo ture JSON with include syntax into a normal JSON, a build process is needed,\nthat's what the implementation does.\n\nPython Implementation\n---------------------\n\nImplementation could be of any language as long as it can understand the include syntax\nand output as expected, this repo contains a Python implementation for use.\n\nInstallation\n~~~~~~~~~~~~\n\n::\n\n    pip install json-include\n\nUsage\n~~~~~\n\nBy installation a command called ``json-include`` will be registerd as an entry point,\nuse it as follows::\n\n    usage: json-include [-h] DIR FILE\n\n    Command line tool to build JSON file by include syntax.\n\n    positional arguments:\n      DIR         The directory path of source json files\n      FILE        The name of the source json file\n\n    optional arguments:\n      -h, --help  show this help message and exit\n\nFor example::\n\n    json-include test/source_json/ c.json\n\nThe parsed and built result of ``c.json`` will be printed.\n\nFurther usage of ``json_include`` package is documented in its source code,\nand ``test/`` can also give you better understandings of how it works.\n\nTODOs\n-----\n\n- [ ] Prevent circluar inclusion\n- [ ] Test circluar inclusion\n- [ ] Test invalid syntax\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freorx%2Fjson_include","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Freorx%2Fjson_include","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Freorx%2Fjson_include/lists"}