{ "info": { "author": "Jan Vlcinsky", "author_email": "jan.vlcinsky@cdv.cz", "bugtrack_url": null, "classifiers": [], "description": "=============\njsoncatalogue\n=============\n\nPackage `jsoncatalogue` allows reading set of JSON files from directory structure resembling urls.\n\nFiles are loaded and provided as simple url: jsoncontent dictionary.\n\nSuch a dictionary can be used as catalogue of JSON schemas for JSON Schema validation.\n\nInstallation\n============\n::\n\n $ pip install jsoncatalogue \n\n\nStructure of directory with JSON files\n======================================\n\nIf you want to have catalogue for Swagger v1.2 validation::\n\n ./catalogue/http/wordnik.github.io/schemas/v1.2/apiDeclaration.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/infoObject.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/authorizationObject.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/modelsObject.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/operationObject.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/parameterObject.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/dataTypeBase.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/oauth2GrantType.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/resourceObject.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/dataType.json\n ./catalogue/http/wordnik.github.io/schemas/v1.2/resourceListing.json\n\nwhere\n\n- `catalogue` - is catalogue \"home\" directory (can be deeper)\n- `http`- is protocol name. Can be any other, like `ftp`...\n- `wordnik.github.io` - domain name\n- `schemas/v1.2` - local path to JSON files\n- `apiDeclaration.json` - actual JSON file - must be valid JSON file (no other requirement exist)\n\nAs you see, there are no complex rules to follow, just have uri leading to valid JSON file (which is not even required to have an extension \".json\")\n\n\nLoading JSON Catalogue from directory\n-------------------------------------\n::\n\n >>> from jsoncatalogue import Catalogue\n >>> catalogue = Catalogue()\n >>> catalogue.add_directory(\"catalog\")\n >>> catalogue.add_directory(\"../other/catalog\")\n >>> catalogue.store\n {\"http://exam.ple/schema/one.json\": {...},\n \"http://exam.ple/schema/two.json\": {...},\n \"http://wordnik.github.io/schema/v1.2/apiAuthentication.json\": {...}\n \"http://no.extensi.on/schema/pets\": {...}\n }\n\nAnd this is all. You now have a dictionary with uris and related JSON content. The JSON content is already loaded and is represented as dictionary.\n\nUsing catalogue for JSON Schema validator\n-----------------------------------------\n\nThis catalogue.store can be assigned e.g. to `jsonschema` validator::\n\n >>> from jsonschema import Draft4Validator\n >>> validator = Draft4Validator()\n >>> validator.resolver.store = catalogue.store\n\nFrom now on, validator will know about schemas from catalogue\n\n.. note:: Initial development done during work for CDV_ on project SUPERHUB_. The package is published under MIT license with permision of CDV_.\n\n.. _CDV: http://www.cdv.cz\n\n.. _SUPERHUB: http://www.superhub-project.eu", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://bitbucket.org/vlcinsky/sh-jsoncatalogue", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "jsoncatalogue", "package_url": "https://pypi.org/project/jsoncatalogue/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/jsoncatalogue/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://bitbucket.org/vlcinsky/sh-jsoncatalogue" }, "release_url": "https://pypi.org/project/jsoncatalogue/0.1.1/", "requires_dist": null, "requires_python": null, "summary": "Local filesystem based JSON catalogue, usable e.g. with package `jsonschema`", "version": "0.1.1" }, "last_serial": 1282134, "releases": { "0.1.1": [ { "comment_text": "", "digests": { "md5": "f351e935df00812a2dde9f88fd00473e", "sha256": "35b8514f25a6fb1771220334e45049a65a50125d2d727a4471d8c01e86b478d6" }, "downloads": -1, "filename": "jsoncatalogue-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f351e935df00812a2dde9f88fd00473e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8968, "upload_time": "2014-10-25T00:44:32", "url": "https://files.pythonhosted.org/packages/01/1f/efea3ac5b0e02bd629ae0ab3c5a76eb1eafedab26edcf62ba59e3631bd5c/jsoncatalogue-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f351e935df00812a2dde9f88fd00473e", "sha256": "35b8514f25a6fb1771220334e45049a65a50125d2d727a4471d8c01e86b478d6" }, "downloads": -1, "filename": "jsoncatalogue-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f351e935df00812a2dde9f88fd00473e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8968, "upload_time": "2014-10-25T00:44:32", "url": "https://files.pythonhosted.org/packages/01/1f/efea3ac5b0e02bd629ae0ab3c5a76eb1eafedab26edcf62ba59e3631bd5c/jsoncatalogue-0.1.1.tar.gz" } ] }