{ "info": { "author": "Andrew Seier", "author_email": "andseier@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "JSON Variables\n==============\n\nNutshell\n--------\n\nThis is a non-standard implementation extending JSON pointers:\n\nhttps://tools.ietf.org/html/draft-ietf-appsawg-json-pointer-04\n\nIt allows you to reference parts of a JSON document from within the same\ndocument *from within a sub-string*.\n\nIn other words, JSON Pointers can handle resolving things like:\n\n::\n\n {\n \"a\": \"foo\",\n \"b\": \"/a\"\n }\n\nHowever, this proposes a new *variable* spec requiring an additional\ntemplate:\n\n::\n\n {\n \"a\": \"foo\",\n \"b\": \"{{/a}}\"\n }\n\nBy using a template, we can replace sub-strings:\n\n::\n\n {\n \"a\": \"foo\",\n \"b\": \"{{/a}}, bar!\"\n }\n\nExample\n-------\n\nThe motivation for this is to try and share settings between the\nfront-end and back-end of an application, settings within the same JSON\ndocument can reference each other to prevent repetition. Consider the\nfollowing document:\n\n::\n\n {\n \"USERNAME_REGEX\": \"[a-zA-Z0-9._-]{3,30}\",\n \"USERNAMES_REGEX\": \"{{/USERNAME_REGEX}}(?:,{{/USERNAME_REGEX}})*\",\n \"FILE_ID_REGEX\": \"{{/USERNAME_REGEX}}:\\\\d+\"\n }\n\nAfter de-referencing the variables, you get:\n\n::\n\n {\n \"USERNAME_REGEX\": \"[a-zA-Z0-9._-]{3,30}\",\n \"USERNAMES_REGEX\": \"[a-zA-Z0-9._-]{3,30}(?:,[a-zA-Z0-9._-]{3,30})*\",\n \"FILE_ID_REGEX\": \"[a-zA-Z0-9._-]{3,30}:\\\\d+\"\n }\n\nThe original document is more readable and revisions to the first value\nonly require changing *one* line.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/theengineear/json_variable", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "json_variable", "package_url": "https://pypi.org/project/json_variable/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/json_variable/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/theengineear/json_variable" }, "release_url": "https://pypi.org/project/json_variable/0.0.1/", "requires_dist": null, "requires_python": null, "summary": "Sub-string Extension to JSON Pointer References.", "version": "0.0.1" }, "last_serial": 2174412, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "bf80a0b1158dcbdaee98c169d66e20d1", "sha256": "4cd7e0767f39492947904717b022416169656acdd7458f1aa856c6e01aaae079" }, "downloads": -1, "filename": "json_variable-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bf80a0b1158dcbdaee98c169d66e20d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3169, "upload_time": "2016-06-18T05:59:05", "url": "https://files.pythonhosted.org/packages/fc/4f/fa506fc7ad9fd40c2ec50cff998b327b53f68cf65bfdd83494e486f90a31/json_variable-0.0.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "bf80a0b1158dcbdaee98c169d66e20d1", "sha256": "4cd7e0767f39492947904717b022416169656acdd7458f1aa856c6e01aaae079" }, "downloads": -1, "filename": "json_variable-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bf80a0b1158dcbdaee98c169d66e20d1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3169, "upload_time": "2016-06-18T05:59:05", "url": "https://files.pythonhosted.org/packages/fc/4f/fa506fc7ad9fd40c2ec50cff998b327b53f68cf65bfdd83494e486f90a31/json_variable-0.0.1.tar.gz" } ] }