{ "info": { "author": "Maastricht University - DataHub", "author_email": "datahub@maastrichtuniversity.nl", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3" ], "description": "# Bidirectional conversion between JSON(-LD) and iRODS AVUs\n\n## Rationale\n\nJSON is a flexible and easy to use format for storing (nested) data. At the same time \nit can remain human readable. It can therefor be an ideal method for \nstoring metadata in iRODS. However, iRODS uses Attribute, Value, Unit triples. Its \nlargest drawback being the lack of nesting. \n\nThis script describes a method for converting JSON to AVU triples and back again \n(bidirectional).\n\n## Design goals\n\n* Bijection between JSON <-> AVU\n * i.e no limit on the characters used in an attribute\n * i.e being able to maintain order in arrays\n* Lean JSON -> AVU conversion. \n * Don't explode the JSON unnecessarily in AVUs\n* Keep Attribute->Value pairs the same in JSON and AVUs. So values remain easily accessible from within iRODS\n* Compatible with existing or additional AVUs \n* Compatible/aware of JSON-LD\n\n\n## Implementation\nThe unit is field is being used for the following purposes:\n\n* Defining the JSON root\n* The parent object (0 by default)\n* The object type (o, s, b, a, n, z, e)\n* The array index\n\nAVUs only allow a string value. The types are converted as follows:\n\n* s: string \n* o: object (\"o\" + object_id)\n* b: boolean (\"True\" or \"False\")\n* n: number (String value of float or int)\n* z: null (\".\")\n* e: empty string (\".\") (special case as AVUs don't allow empty values)\n* a: empty array (\".\")\n\n## Installation\nEither clone the git repository, or use pip to install only the module into your virtual environment:\n```bash\npip install https://github.com/MaastrichtUniversity/irods_avu_json/archive/master.zip\n```\n\n## Example output\n```\nSource:\n{\n \"k1\": \"v1\",\n \"k2\": {\n \"k3\": \"v2\",\n \"k4\": \"v3\"\n },\n \"k5\": [\n \"v4\",\n \"v5\"\n ],\n \"k6\": [\n {\n \"k7\": \"v6\",\n \"k8\": \"v7\"\n }\n ]\n}\nAVUs:\n A V U\n k1 v1 root_0_s\n k2 o1 root_0_o1\n k3 v2 root_1_s\n k4 v3 root_1_s\n k5 v4 root_0_s#0\n k5 v5 root_0_s#1\n k6 o2 root_0_o2#0\n k7 v6 root_2_s\n k8 v7 root_2_s\nJSON:\n{\n \"k1\": \"v1\",\n \"k2\": {\n \"k3\": \"v2\",\n \"k4\": \"v3\"\n },\n \"k5\": [\n \"v4\",\n \"v5\"\n ],\n \"k6\": [\n {\n \"k7\": \"v6\",\n \"k8\": \"v7\"\n }\n ]\n}\n```\n## Development helpers\n\nUse the `conversion.py` script for easy development. Compatible with Python 2 and 3.\n\n```bash\npython conversion.py inputs/basic.json\n```\n\n## Testing\nTests can be run from the `test` directory. Only in Python3.\n\n```bash\npython3 -m unittest test.TestIrodsAvuJson\n```\n\n## Limits\n\nOn the AVU side\n* If two AVUs have the same attribute and unit but different values only the last one ends up in the JSON\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/MaastrichtUniversity/irods_avu_json", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "irods-avu-json", "package_url": "https://pypi.org/project/irods-avu-json/", "platform": "", "project_url": "https://pypi.org/project/irods-avu-json/", "project_urls": { "Homepage": "https://github.com/MaastrichtUniversity/irods_avu_json" }, "release_url": "https://pypi.org/project/irods-avu-json/2.0.0/", "requires_dist": null, "requires_python": "", "summary": "Bidirectional conversion between JSON(-LD) and iRODS AVUs", "version": "2.0.0" }, "last_serial": 5461825, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "fa9aed2da9bc997542aa806722eef4f2", "sha256": "54d4b187d5ce6d8ce16eb282eae0f16f812fbbaadfdf190e9232b5ddbd524191" }, "downloads": -1, "filename": "irods_avu_json-1.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "fa9aed2da9bc997542aa806722eef4f2", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9050, "upload_time": "2019-06-24T15:13:33", "url": "https://files.pythonhosted.org/packages/8e/b9/164a52660b58f0ff33f358314541b88d0ae6083d9fbad2aeaa651166d9aa/irods_avu_json-1.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4be2590ae478c2e210ad0acdf0025a62", "sha256": "fb2b190a43620d746611e6c4edaea894d953d8c69a61f06e47fb0bcc55d83c24" }, "downloads": -1, "filename": "irods_avu_json-1.0.0.tar.gz", "has_sig": false, "md5_digest": "4be2590ae478c2e210ad0acdf0025a62", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5802, "upload_time": "2019-06-24T15:13:35", "url": "https://files.pythonhosted.org/packages/87/a5/9a58a914ded17958db84a53b519056ba41890361477d42e34ff2a11f1049/irods_avu_json-1.0.0.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "9868534cc06babf00f7c4107a9b7946e", "sha256": "0837cd491099496d363b749b1e8983d609174f964fd1051d6f004925d5e07c37" }, "downloads": -1, "filename": "irods_avu_json-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9868534cc06babf00f7c4107a9b7946e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9158, "upload_time": "2019-06-28T13:57:50", "url": "https://files.pythonhosted.org/packages/83/91/0ffa4125b56b80fdb4911200b9f05e703eeec57d92738e576e79f186898f/irods_avu_json-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "29bb036eecca08525e1cf6bdf3c87bd2", "sha256": "9cf96233242c54b4b0fd0da95fa9174f5561cdc6637db8e509e0d58368874c16" }, "downloads": -1, "filename": "irods_avu_json-2.0.0.tar.gz", "has_sig": false, "md5_digest": "29bb036eecca08525e1cf6bdf3c87bd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6072, "upload_time": "2019-06-28T13:57:52", "url": "https://files.pythonhosted.org/packages/cd/6b/534c23ddd575ad42e87dea051630dcd47cbdd282a7856709856549e67f8b/irods_avu_json-2.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "9868534cc06babf00f7c4107a9b7946e", "sha256": "0837cd491099496d363b749b1e8983d609174f964fd1051d6f004925d5e07c37" }, "downloads": -1, "filename": "irods_avu_json-2.0.0-py3-none-any.whl", "has_sig": false, "md5_digest": "9868534cc06babf00f7c4107a9b7946e", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9158, "upload_time": "2019-06-28T13:57:50", "url": "https://files.pythonhosted.org/packages/83/91/0ffa4125b56b80fdb4911200b9f05e703eeec57d92738e576e79f186898f/irods_avu_json-2.0.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "29bb036eecca08525e1cf6bdf3c87bd2", "sha256": "9cf96233242c54b4b0fd0da95fa9174f5561cdc6637db8e509e0d58368874c16" }, "downloads": -1, "filename": "irods_avu_json-2.0.0.tar.gz", "has_sig": false, "md5_digest": "29bb036eecca08525e1cf6bdf3c87bd2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6072, "upload_time": "2019-06-28T13:57:52", "url": "https://files.pythonhosted.org/packages/cd/6b/534c23ddd575ad42e87dea051630dcd47cbdd282a7856709856549e67f8b/irods_avu_json-2.0.0.tar.gz" } ] }