{ "info": { "author": "Ferry Boender", "author_email": "ferry.boender@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "JSONxs\n======\n\nJSONxs is a Python library that uses a path expression string to get and\nset values in JSON and Python datastructures. It's slightly similar to\nJSONPath, but supports only simpler expressions and allows\nmodifications.\n\nJSONxs is safe to use with untrusted input.\n\nExamples\n--------\n\nGiven the folowing datastructure:\n\n::\n\n d = {\n 'feed': {\n 'id': 'my_feed',\n 'url': 'http://example.com/feed.rss',\n 'tags': ['devel', 'example', 'python'],\n 'short.desc': 'A feed',\n }\n }\n\nWe can get, set and delete values from the stucture.\n\n::\n\n jsonxs(d, 'feed.id') # Get the 'id' field: 'my_feed'\n jsonxs(d, 'feed.tags') # Get the list of tags.\n jsonxs(d, 'feed.tags[-1]') # Get the last item in the 'tags' list: 'python'\n jsonxs(d, 'feed.short\\.desc') # Escape special char\n jsonxs(d, 'feed.long\\.desc', default='N/A') # Return default when key not found\n jsonxs(d, 'feed.id', ACTION_SET, 'your_feed') # Set feed id to 'your_feed'\n jsonxs(d, 'feed.tags[-1]', ACTION_SET, 'javascript') # Replace 'python' with 'javascript'\n jsonxs(d, 'feed.tags[0]', ACTION_DEL) # Delete the first tag\n jsonxs(d, 'feed.url', ACTION_DEL) # Delete the 'url' key from a dict\n jsonxs(d, 'feed.tags', ACTION_APPEND, 'programming') # Append 'programming' to tags\n jsonxs(d, 'feed.tags[1]', ACTION_INSERT, 'tech') # Insert 'tech' at pos 1 in tags\n jsonxs(d, 'feed.author', ACTION_SET, 'Ferry Boender') # Create new key/string value in dict \n jsonxs(d, 'feed.details', ACTION_MKDICT) # Create new key/dict value in dict\n jsonxs(d, 'feed.details', ACTION_MKLIST) # Create new key/list value in dict\n\nInstallation and usage\n----------------------\n\nTo install:\n\n::\n\n pip install jsonxs\n\nTo use:\n\n::\n\n import jsonxs\n\n data = {'foo': 1}\n jsonxs.jsonxs(data, 'bar', jsonxs.ACTION_SET, 2)\n print data # {'foo': 1, 'bar': 2}\n\n\nLicense\n-------\n\nJSONxs is licensed under the MIT license:\n\nCopyright (c) 2015 Ferry Boender (ferry.boender@gmail.com)\n\nPermission is hereby granted, free of charge, to any person obtaining a\ncopy of this software and associated documentation files (the\n\"Software\"), to deal in the Software without restriction, including\nwithout limitation the rights to use, copy, modify, merge, publish,\ndistribute, sublicense, and/or sell copies of the Software, and to\npermit persons to whom the Software is furnished to do so, subject to\nthe following conditions:\n\nThe above copyright notice and this permission notice shall be included\nin all copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS\nOR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\nIN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY\nCLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,\nTORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE\nSOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/fboender/jsonxs", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "jsonxs", "package_url": "https://pypi.org/project/jsonxs/", "platform": "", "project_url": "https://pypi.org/project/jsonxs/", "project_urls": { "Homepage": "https://github.com/fboender/jsonxs" }, "release_url": "https://pypi.org/project/jsonxs/0.6/", "requires_dist": null, "requires_python": "", "summary": "Use path expression strings to get and set values in JSON", "version": "0.6" }, "last_serial": 3101204, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8fb592e24c4d3ce8c5e584d94b2f555a", "sha256": "34ff9eed7d9e169d932afc8f479e0d7c5d625fde5d2b256769c11f3fcdb6c705" }, "downloads": -1, "filename": "jsonxs-0.1.tar.gz", "has_sig": false, "md5_digest": "8fb592e24c4d3ce8c5e584d94b2f555a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3719, "upload_time": "2015-12-15T21:30:53", "url": "https://files.pythonhosted.org/packages/75/6f/b28915edcebd2dbdc508ae1b05c5c60eaeadbf83098c132c57afbdbc55bf/jsonxs-0.1.tar.gz" } ], "0.2": [ { "comment_text": "", "digests": { "md5": "d22c5d6abcefda914552a4ff62b889a1", "sha256": "c03b071ed8cb0af630cd74ae4fbedc9ab073b4fcf35779cb9aeb40b1feb6218d" }, "downloads": -1, "filename": "jsonxs-0.2.tar.gz", "has_sig": false, "md5_digest": "d22c5d6abcefda914552a4ff62b889a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3811, "upload_time": "2015-12-19T06:59:33", "url": "https://files.pythonhosted.org/packages/90/14/7a47d93efe4f1816315d7ab08b0c766f6dea21d1d673309dfb1894144836/jsonxs-0.2.tar.gz" } ], "0.3": [ { "comment_text": "", "digests": { "md5": "615d7cf01206e90259089d5155faf7d8", "sha256": "2463bad387a675c62a66191164ce18f950d643c452ae17a98275fc622dcb5e26" }, "downloads": -1, "filename": "jsonxs-0.3.tar.gz", "has_sig": false, "md5_digest": "615d7cf01206e90259089d5155faf7d8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3948, "upload_time": "2016-07-29T07:24:56", "url": "https://files.pythonhosted.org/packages/ff/1c/54c1648ef15a9bfec2390e38ac95bb7da7b0cce938db41aeb81dbc659c35/jsonxs-0.3.tar.gz" } ], "0.4": [ { "comment_text": "", "digests": { "md5": "46045d0cf72d23a1d378b053df8a1c75", "sha256": "20455b75ae102478ec2b79acadb97ca62f03995e13bf0a8357c53a25e449f1ee" }, "downloads": -1, "filename": "jsonxs-0.4.tar.gz", "has_sig": false, "md5_digest": "46045d0cf72d23a1d378b053df8a1c75", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3959, "upload_time": "2017-02-02T08:06:11", "url": "https://files.pythonhosted.org/packages/ec/4a/02adbd0512da8dc35d1fa0bc8f1db59e9eccd6080958a5dae793a81a6c2a/jsonxs-0.4.tar.gz" } ], "0.5": [ { "comment_text": "", "digests": { "md5": "5a2576fc3dc89606a1715abecd29f01b", "sha256": "5eaf8aeb9a46f1adecd73e75a6dba60d39081a3d74b50886a0eda68a35c72e06" }, "downloads": -1, "filename": "jsonxs-0.5.tar.gz", "has_sig": false, "md5_digest": "5a2576fc3dc89606a1715abecd29f01b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3995, "upload_time": "2017-08-15T18:10:28", "url": "https://files.pythonhosted.org/packages/97/e0/579ccaad2b3e994bb1887771bc6b95026fc5fa0fe15cbafc6601ad273c5c/jsonxs-0.5.tar.gz" } ], "0.6": [ { "comment_text": "", "digests": { "md5": "35bf2ed747619e0ce5a9bd4d4f204bd6", "sha256": "dc41ae07961f3f19f97241e4c7f611d84d076c420dd2876aadfd936e59c8c302" }, "downloads": -1, "filename": "jsonxs-0.6.tar.gz", "has_sig": false, "md5_digest": "35bf2ed747619e0ce5a9bd4d4f204bd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4071, "upload_time": "2017-08-16T16:39:22", "url": "https://files.pythonhosted.org/packages/65/62/67257a84338fde1b89fce8b28164364bf2ad6a5a4459a6a890cf497cf721/jsonxs-0.6.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "35bf2ed747619e0ce5a9bd4d4f204bd6", "sha256": "dc41ae07961f3f19f97241e4c7f611d84d076c420dd2876aadfd936e59c8c302" }, "downloads": -1, "filename": "jsonxs-0.6.tar.gz", "has_sig": false, "md5_digest": "35bf2ed747619e0ce5a9bd4d4f204bd6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4071, "upload_time": "2017-08-16T16:39:22", "url": "https://files.pythonhosted.org/packages/65/62/67257a84338fde1b89fce8b28164364bf2ad6a5a4459a6a890cf497cf721/jsonxs-0.6.tar.gz" } ] }