{ "info": { "author": "Mislav Cimper\u0161ak", "author_email": "mislav.cimpersak@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 2 - Pre-Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: BSD License", "Natural Language :: English", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "============\nJSON:API ORM\n============\n\n\n.. image:: https://img.shields.io/pypi/v/jsonapi_orm.svg\n :target: https://pypi.python.org/pypi/jsonapi_orm\n\n.. image:: https://img.shields.io/circleci/project/github/mislavcimpersak/jsonapi-orm.svg\n :target: https://circleci.com/gh/mislavcimpersak/jsonapi-orm\n :alt: CircleCI\n\n.. image:: https://img.shields.io/coveralls/github/mislavcimpersak/jsonapi-orm.svg\n :target: https://coveralls.io/github/mislavcimpersak/jsonapi-orm\n :alt: Coveralls github\n\n.. image:: https://readthedocs.org/projects/jsonapi-orm/badge/?version=latest\n :target: https://jsonapi-orm.readthedocs.io/en/latest/?badge=latest\n :alt: Documentation Status\n\n\n\n\nQuick and dirty ORM that maps JSON:API responses to object attributes.\n\n\n* Free software: BSD license\n* Documentation: https://jsonapi-orm.readthedocs.io.\n\n\nHow To\n------\n\nUse Requests_ or (if you are a masochist) Python's built-in urllib modules to make the request to your JSON:API service and from there pass the response to JSON:API ORM.\n\nSo, first install requests and this lib:\n\n.. code-block:: bash\n\n pip install requests\n pip install jsonapi-orm\n\nSwitch to your Python code and use the magic!\n\n.. code-block:: python\n\n import requests\n from jsonapi_orm import response_to_obj\n\n\n # list of items\n r = requests.get('https://raw.githubusercontent.com/mislavcimpersak/jsonapi-orm/master/tests/responses/example_list.json')\n obj = response_to_obj(r.json())\n\n print('LIST OF ITEMS:')\n for item in obj.data:\n print(item.title)\n # author is defined as a relationship\n print(item.author.twitter)\n\n\n # single item\n r = requests.get('https://raw.githubusercontent.com/mislavcimpersak/jsonapi-orm/master/tests/responses/example_single.json')\n obj = response_to_obj(r.json())\n\n print('SINGLE ITEM')\n print(obj.data.title)\n # author is defined as a relationship\n print(obj.data.author.id)\n print(obj.data.author.twitter)\n\n\nCaveats\n-------\n\n* Since Python object attribute names `have certain rules`__ like not starting with a number or not containing \"-\" char, all such attributes can be accessed using ``.get()`` method. Ie. ``obj.data.author.get('first-name')``.\n\n* If relationship is not described in more detail in the ``included`` part of the response matching fails silently.\n\n* For now, this lib does not lazily follow relationship links or anything like that. You can of course make a new request to the given link and pass that response to JSON:API ORM.\n\n* For now, there is no check if response is a valid JSON:API response. But you'll probably get that you are trying to parse an invalid response when things start to break.\n\n* And last, this lib requires Python 3.5 or newer.\n\n\n.. _Requests: http://docs.python-requests.org\n.. _rules: https://docs.python.org/3/reference/lexical_analysis.html#identifiers\n\n__ rules_\n\n\n=======\nHistory\n=======\n\n0.1.8 (2018-04-06)\n------------------\n\n* Added test config and basic tests.\n\n0.1.7 (2018-03-25)\n------------------\n\n* Using readme.rst for frontpage of the docs.\n\n0.1.7 (2018-03-25)\n------------------\n\n* Fixed pip install.\n\n0.1.6 (2018-03-25)\n------------------\n\n* Readme fix for pypi.\n\n0.1.5 (2018-03-25)\n------------------\n\n* Readme fix for pypi.\n\n0.1.4 (2018-03-25)\n------------------\n\n* Readme examples using slighty modified examples from jsonapi.org which are located in this repo.\n\n0.1.3 (2018-03-25)\n------------------\n\n* Fixed a bug when child data is non-existent.\n\n0.1.2 (2018-03-25)\n------------------\n\n* Fixed a bug when included is not present in response.\n\n0.1.0 (2018-03-24)\n------------------\n\n* First release on PyPI.\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/mislavcimpersak/jsonapi-orm", "keywords": "jsonapi-orm", "license": "BSD license", "maintainer": "", "maintainer_email": "", "name": "jsonapi-orm", "package_url": "https://pypi.org/project/jsonapi-orm/", "platform": "", "project_url": "https://pypi.org/project/jsonapi-orm/", "project_urls": { "Homepage": "https://github.com/mislavcimpersak/jsonapi-orm" }, "release_url": "https://pypi.org/project/jsonapi-orm/0.1.8/", "requires_dist": [ "munch" ], "requires_python": "", "summary": "Quick and dirty ORM that maps JSON:API responses to object attributes.", "version": "0.1.8" }, "last_serial": 3740507, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "040eed6258828b4c2b7dd4edda9805da", "sha256": "06bfce56a28562f10e260b22c0635669a737846b004db279bf47098d6c00dfaf" }, "downloads": -1, "filename": "jsonapi_orm-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "040eed6258828b4c2b7dd4edda9805da", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2792, "upload_time": "2018-03-24T03:15:50", "url": "https://files.pythonhosted.org/packages/bd/cf/f1f7fb5dc63f9f22e8867f76d85aeacb5f6aa2a27c233b31b221b15a0f45/jsonapi_orm-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4ba0f3cfe5c055a5ba37bd4dfd2ed5b4", "sha256": "41ea43a5d8b92d589c062f0083cafb03be7eb634114689da7f0e018bdadb69bd" }, "downloads": -1, "filename": "jsonapi-orm-0.1.0.tar.gz", "has_sig": false, "md5_digest": "4ba0f3cfe5c055a5ba37bd4dfd2ed5b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14175, "upload_time": "2018-03-24T03:15:52", "url": "https://files.pythonhosted.org/packages/de/e4/d73d6ee26e20ee4f082503beeb11f745fc187dc59a69600c4cc76566057d/jsonapi-orm-0.1.0.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "0c4201d9b6ad7d0d5bd548266e06249f", "sha256": "65ef19658d7f1cf75c272884d2f1f7829d04550a3249ee0b167ddb490f2e96fa" }, "downloads": -1, "filename": "jsonapi_orm-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0c4201d9b6ad7d0d5bd548266e06249f", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3558, "upload_time": "2018-03-25T11:37:37", "url": "https://files.pythonhosted.org/packages/cb/8a/ada72144817a3b62ee4301b4330be32372aa9b3d293d6e13606118b84fb2/jsonapi_orm-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1cc4f8ad81c1b8d65cca013d94ba89a1", "sha256": "dd0c1b0395bd6443333af905e66a3c12b66ded34deeb7ab36350e28c9aa68c42" }, "downloads": -1, "filename": "jsonapi-orm-0.1.2.tar.gz", "has_sig": false, "md5_digest": "1cc4f8ad81c1b8d65cca013d94ba89a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 14992, "upload_time": "2018-03-25T11:37:38", "url": "https://files.pythonhosted.org/packages/7a/56/084d6be0703cced9a304229f1f794e8ecf8d67fe1c200ef191a0ee76326a/jsonapi-orm-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "ce0d1c1af47754a44ad77e49a13401c6", "sha256": "47fbc24bdd9ebc4c949456ea457b96a63d412e199c4669725a9f464b49a2fcbd" }, "downloads": -1, "filename": "jsonapi_orm-0.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ce0d1c1af47754a44ad77e49a13401c6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 3598, "upload_time": "2018-03-25T11:57:22", "url": "https://files.pythonhosted.org/packages/05/f1/01f16b927db1d47190b9f51dcaf077cf5d56f4762a6dbbace67442e4b177/jsonapi_orm-0.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2dff4ea96d67f1b280fbe419d348224d", "sha256": "ee9c0d15031ba3e9bcb6ff3384b8b4687ed85cb36f0dd6946d8dd912422b8125" }, "downloads": -1, "filename": "jsonapi-orm-0.1.3.tar.gz", "has_sig": false, "md5_digest": "2dff4ea96d67f1b280fbe419d348224d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 15036, "upload_time": "2018-03-25T11:57:23", "url": "https://files.pythonhosted.org/packages/6e/45/6e8207b6b46a133cc776843c32603618f6c2850cab8ca9dce01fc679cfb2/jsonapi-orm-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "0c50b50a77ed5d79329449f6f9fe1bfa", "sha256": "c376b60c934c2796b2f911330a2fc59cf940758df9dfe6035e67bbf9b18f1fdd" }, "downloads": -1, "filename": "jsonapi_orm-0.1.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0c50b50a77ed5d79329449f6f9fe1bfa", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4647, "upload_time": "2018-03-25T13:23:40", "url": "https://files.pythonhosted.org/packages/89/dd/93c3e79e8e4aa6335b32a046c35456730efd0799bd873556d6e37d0f0244/jsonapi_orm-0.1.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3b32f8af3162c25d835aea9080b03cb3", "sha256": "9b9578ec3de1d09d9f42089776f116e9c912b706144790b24bdc11ba9574470b" }, "downloads": -1, "filename": "jsonapi-orm-0.1.4.tar.gz", "has_sig": false, "md5_digest": "3b32f8af3162c25d835aea9080b03cb3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16182, "upload_time": "2018-03-25T13:23:41", "url": "https://files.pythonhosted.org/packages/3f/4e/375609b224189ed432d899b80001a96ee6e2ba65aa46d0da3c3a39ba5a99/jsonapi-orm-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "c8663d28e970ec79fcb422ee093f579d", "sha256": "edd9c51e792eef1da475fb7a1f84dcdba659ab813b20852b4fe7fece554f6ddf" }, "downloads": -1, "filename": "jsonapi_orm-0.1.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c8663d28e970ec79fcb422ee093f579d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4663, "upload_time": "2018-03-25T13:37:15", "url": "https://files.pythonhosted.org/packages/7c/5d/4aae076fbb40589c5f9771bfbd201b72dd42e4f358af5d552cd291437c6c/jsonapi_orm-0.1.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b11523aa345350dc24a5d52eb918a2e9", "sha256": "4dcff668a2582eff8d006960358eaaba10c287fd75a55f4616afa95adf100ce8" }, "downloads": -1, "filename": "jsonapi-orm-0.1.5.tar.gz", "has_sig": false, "md5_digest": "b11523aa345350dc24a5d52eb918a2e9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16215, "upload_time": "2018-03-25T13:37:16", "url": "https://files.pythonhosted.org/packages/9c/fc/9483737e1743048d192682d1b0147da28a414f0ecf4dee6c7189c56c6fd0/jsonapi-orm-0.1.5.tar.gz" } ], "0.1.6": [ { "comment_text": "", "digests": { "md5": "a6cefeb72a5eae59f214b654772b0261", "sha256": "87f1e68594cd77e986017183e2b35c370682bbe27d55826a2ab82f46157f4da8" }, "downloads": -1, "filename": "jsonapi_orm-0.1.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a6cefeb72a5eae59f214b654772b0261", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 4677, "upload_time": "2018-03-25T13:39:08", "url": "https://files.pythonhosted.org/packages/b6/d7/6d369bf13365fa5f2d9a0d2a3d5e7cc7756dce081ccfc283db7ac50a093a/jsonapi_orm-0.1.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "678edddcfc194a38e2ed3c230c56e51a", "sha256": "a3906b7b0f8237e7604c0438dadec0f55a99f9f885ffed35f5b4a66649f5eb06" }, "downloads": -1, "filename": "jsonapi-orm-0.1.6.tar.gz", "has_sig": false, "md5_digest": "678edddcfc194a38e2ed3c230c56e51a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 16220, "upload_time": "2018-03-25T13:39:09", "url": "https://files.pythonhosted.org/packages/24/90/0b36f12cc309df88f68dd48263b349eefea41ee02e53f9a636f08a88743f/jsonapi-orm-0.1.6.tar.gz" } ], "0.1.7": [ { "comment_text": "", "digests": { "md5": "37be8561871927631ab0f5ecc40d4ceb", "sha256": "fc30aa6fb6c726af57baae5619eaad746ef6dacdfcb11ff1ddaf4fa0fa3c1a21" }, "downloads": -1, "filename": "jsonapi_orm-0.1.7-py3-none-any.whl", "has_sig": false, "md5_digest": "37be8561871927631ab0f5ecc40d4ceb", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7217, "upload_time": "2018-03-25T14:50:17", "url": "https://files.pythonhosted.org/packages/db/7c/1043bf01c49c7b374cbf962a64faf18098e76bd586b51d7b4a422fbf1019/jsonapi_orm-0.1.7-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e52cb8cc6c1d74ad91027351139bb8a1", "sha256": "ae8d1fbbb2f543dd972617efba6797ed67938176595114a7765d68751d2cfe2d" }, "downloads": -1, "filename": "jsonapi-orm-0.1.7.tar.gz", "has_sig": false, "md5_digest": "e52cb8cc6c1d74ad91027351139bb8a1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17400, "upload_time": "2018-03-25T14:50:18", "url": "https://files.pythonhosted.org/packages/24/6d/32173e475ee3c3f45fad05bbdb458f87643cd5372660facd48994dc19d9c/jsonapi-orm-0.1.7.tar.gz" } ], "0.1.8": [ { "comment_text": "", "digests": { "md5": "cde89777788fd5f9ffa4d573855864b4", "sha256": "f0c82842950075d1931d17bbfe563ef562cea6b6e56bb7d1f8a717f32035e533" }, "downloads": -1, "filename": "jsonapi_orm-0.1.8-py3-none-any.whl", "has_sig": false, "md5_digest": "cde89777788fd5f9ffa4d573855864b4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7474, "upload_time": "2018-04-06T09:20:33", "url": "https://files.pythonhosted.org/packages/56/b9/817a6d4322b3baa95594577b6e8c4645d107c4471aa661cf7fe6ec0ab1ea/jsonapi_orm-0.1.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0cbf9468bc98dc223c7d59ede70fa61b", "sha256": "87756e65bfd625e8f15d9b24069a8b16f1d6da3d1469746df444ddaafb0a9118" }, "downloads": -1, "filename": "jsonapi-orm-0.1.8.tar.gz", "has_sig": false, "md5_digest": "0cbf9468bc98dc223c7d59ede70fa61b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18036, "upload_time": "2018-04-06T09:20:34", "url": "https://files.pythonhosted.org/packages/63/ce/87d167a22c4286ce879b3edad928a7598fba46fa38cb4ceee99b881ab860/jsonapi-orm-0.1.8.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "cde89777788fd5f9ffa4d573855864b4", "sha256": "f0c82842950075d1931d17bbfe563ef562cea6b6e56bb7d1f8a717f32035e533" }, "downloads": -1, "filename": "jsonapi_orm-0.1.8-py3-none-any.whl", "has_sig": false, "md5_digest": "cde89777788fd5f9ffa4d573855864b4", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 7474, "upload_time": "2018-04-06T09:20:33", "url": "https://files.pythonhosted.org/packages/56/b9/817a6d4322b3baa95594577b6e8c4645d107c4471aa661cf7fe6ec0ab1ea/jsonapi_orm-0.1.8-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0cbf9468bc98dc223c7d59ede70fa61b", "sha256": "87756e65bfd625e8f15d9b24069a8b16f1d6da3d1469746df444ddaafb0a9118" }, "downloads": -1, "filename": "jsonapi-orm-0.1.8.tar.gz", "has_sig": false, "md5_digest": "0cbf9468bc98dc223c7d59ede70fa61b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18036, "upload_time": "2018-04-06T09:20:34", "url": "https://files.pythonhosted.org/packages/63/ce/87d167a22c4286ce879b3edad928a7598fba46fa38cb4ceee99b881ab860/jsonapi-orm-0.1.8.tar.gz" } ] }