{ "info": { "author": "Alejandro Piad", "author_email": "apiad@apiad.net", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6" ], "description": "# jsonapi [![Travis](https://img.shields.io/travis/apiad/jsonapi.svg?style=flat-square)](https://travis-ci.org/apiad/jsonapi) [![Coveralls github](https://img.shields.io/coveralls/github/apiad/jsonapi.svg?style=flat-square)](https://coveralls.io/github/apiad/jsonapi?branch=master) ![Codacy grade](https://img.shields.io/codacy/grade/6cfc0cf3ee4b442bae0c43bf54a27a58.svg?style=flat-square) [![GitHub tag](https://img.shields.io/github/tag/apiad/jsonapi.svg?style=flat-square&label=current%20version)](https://github.com/apiad/jsonapi/releases) ![Python versions](https://img.shields.io/badge/Python-3.5%2C%203.6-blue.svg?style=flat-square)\n\n> A minimalistic JSON API framework in Python with support for **graphql**-style queries.\n\n**jsonapi** is heavily inspired by [graphql](https://graphql.org), but aimed at a much simpler use case. The idea is to have a minimal framework for easily building JSON based APIs, that doesn't require any particular frontend technology. The design is inspired in **graphql**'s idea of a single fully customizable endpoint, but instead of defining a specific query language, **jsonapi** is entirely based on JSON both for the query and the response, requires much less boilerplate code, only works in Python 3, and of course, is much less battle-tested. If you find **graphql** amazing but would like to try a decaffeinated version that you can setup in 10 lines, then give **jsonapi** a shot.\n\n## Instalation\n\nThe easiest installation is through `pip`. Unfortunately the cute name `jsonapi` was taken already in PyPi, so the project is registered under `jsonapi-simple`.\n\n```\npip install jsonapi-simple\n```\n\nYou can also just clone and distribute with your project's source code:\n\n git clone https://github.com/apiad/jsonapi.git\n\n## Hello world\n\nTo illustrate the usage is best to start with an example. The main class in **jsonapi** is (wait for it...) `JsonApi`, which defines all the available commands in the API as public methods:\n\n```python\n>>> from jsonapi import JsonApi\n\n>>> class HelloWorld(JsonApi):\n... def say(self, message, args):\n... return message.format(args)\n\n```\n\nAfterwards, create an instance of this API and call it, passing along either a JSON-enconded string, or a pure Python dictionary, to query either methods or attributes:\n\n```python\n>>> api = HelloWorld()\n\n>>> api({\"say\": { \"$message\": \"Hello {0}!\", \"$args\": \"world\" }})\n{'say': 'Hello world!'}\n\n```\n\n## Moving on\n\nThere is more that can be done with **jsonapi**, read the [documentation](https://apiad.github.io/jsonapi/) to learn more:\n\n* Perform [structured queries](https://apiad.github.io/jsonapi#querying-complex-objects) with complex structure.\n* Pass [arguments](https://apiad.github.io/jsonapi/operators#function-arguments) to commands.\n* Obtain [aggregated data](https://apiad.github.io/jsonapi/operators#collection-operators) from collections.\n* Manipulate [JSON data](https://apiad.github.io/jsonapi/jsonobj) with an object-oriented syntax.\n* Get [type conversions](https://apiad.github.io/jsonapi/types) automatically for your API schema.\n\n## Contributing\n\nContributions are highly appreciated. Just fork and submit a pull request. All contributors will be granted credit on the following list:\n\n* Alejandro Piad ([@apiad](https://github.com/apiad))\n\n## Changelog\n\n### In the roadmap\n\n* Automatic API documentation.\n\n### v0.2.2\n\n* Finally added to PyPi as [jsonapi-simple](https://pypi.org/project/jsonapi-simple/).\n\n### v0.2.1\n\n* Support for typed arguments.\n\n### v0.2.0\n\n* Support for meta operators in dictionaries (`_count`, `_items`, `_keys`, `_values`).\n* The `JsonObj` constructor now receives either `str`, `dict` or a `**kwargs` mapping.\n\n### v0.1.4\n\n* Support for some meta operators for lists (`_count` and `_items`).\n\n### v0.1.3\n\n* Basic implementation of `JsonObj` for JSON manipulation.\n\n### v0.1.2\n\n* Suport for complex method arguments (parsed via `JsonObj`).\n\n### v0.1.1\n\n* Suport for plain method arguments.\n\n### v0.1\n\n* Basic layout of the API.\n* Simple attribute and method based navigation.\n* Automatic serialization to a JSON compatible object.\n* Basic documentation.\n\n## Colaboration\n\nThis project is licensed MIT, so you know the drill. Fork, open a pull request, and make sure to have up-to-date tests with (ideally) a 100% coverage.\n\n> MIT License\n>\n> Copyright (c) 2018 Alejandro Piad\n>\n> Permission is hereby granted, free of charge, to any person obtaining a copy\n> of this software and associated documentation files (the \"Software\"), to deal\n> in the Software without restriction, including without limitation the rights\n> to use, copy, modify, merge, publish, distribute, sublicense, and/or sell\n> copies of the Software, and to permit persons to whom the Software is\n> furnished to do so, subject to the following conditions:\n>\n> The above copyright notice and this permission notice shall be included in all\n> copies or substantial portions of the Software.\n>\n> THE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\n> IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\n> FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\n> AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\n> LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\n> OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE\n> SOFTWARE.\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/apiad/jsonapi", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "jsonapi-simple", "package_url": "https://pypi.org/project/jsonapi-simple/", "platform": "", "project_url": "https://pypi.org/project/jsonapi-simple/", "project_urls": { "Homepage": "https://github.com/apiad/jsonapi" }, "release_url": "https://pypi.org/project/jsonapi-simple/0.2.2/", "requires_dist": null, "requires_python": "", "summary": "A minimalistic JSON API framework in Python with support for graphql-style queries.", "version": "0.2.2" }, "last_serial": 4746153, "releases": { "0.2.1": [ { "comment_text": "", "digests": { "md5": "0f3d148ece1a8073df1e3c2a9d6cb56a", "sha256": "44f45113de87bb608d8ea4d683023c9176494230eb0c1a258e205c722edbfcd6" }, "downloads": -1, "filename": "jsonapi_simple-0.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "0f3d148ece1a8073df1e3c2a9d6cb56a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 4410, "upload_time": "2019-01-27T13:16:24", "url": "https://files.pythonhosted.org/packages/b0/a6/1ca8a6bf59183f1d0e5e6d7f77e26c78a26b4b8e8ad21bc95e6a6331bdc9/jsonapi_simple-0.2.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e2399a9f0bd498c93b748d155b33eb5c", "sha256": "db6be5aa390a7902d945587838113c5804a8f169dd8a6ddb0dc1fc460106316c" }, "downloads": -1, "filename": "jsonapi-simple-0.2.1.tar.gz", "has_sig": false, "md5_digest": "e2399a9f0bd498c93b748d155b33eb5c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3456, "upload_time": "2019-01-27T13:16:27", "url": "https://files.pythonhosted.org/packages/22/21/39b13fb16107e7680b8b2984b6500c39b97a2fbad47edce9b7df2e95e4ca/jsonapi-simple-0.2.1.tar.gz" } ], "0.2.2": [ { "comment_text": "", "digests": { "md5": "b3f23eff0431eeccf3659d891d6800e5", "sha256": "2d9c03ce340f8fa1cd9d68c62a6ed22af3cc789d21358348077ef17437506c7e" }, "downloads": -1, "filename": "jsonapi_simple-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b3f23eff0431eeccf3659d891d6800e5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6982, "upload_time": "2019-01-27T13:48:46", "url": "https://files.pythonhosted.org/packages/aa/3a/7d31e87e974efcc0822309a8d35c71680c3fa1a89f66db5968415e01ef52/jsonapi_simple-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0326921cbc9a616551c30945702cd2af", "sha256": "05f9670a9bdc8f58759453ba0de3778b48d6f16640a622f34c1f12a7a1c9f5cd" }, "downloads": -1, "filename": "jsonapi-simple-0.2.2.tar.gz", "has_sig": false, "md5_digest": "0326921cbc9a616551c30945702cd2af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5500, "upload_time": "2019-01-27T13:48:47", "url": "https://files.pythonhosted.org/packages/12/a9/c11572734f1e81bd39385ab42d5c6b059c22fee5ed04e44c8868d0d4c5fd/jsonapi-simple-0.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b3f23eff0431eeccf3659d891d6800e5", "sha256": "2d9c03ce340f8fa1cd9d68c62a6ed22af3cc789d21358348077ef17437506c7e" }, "downloads": -1, "filename": "jsonapi_simple-0.2.2-py3-none-any.whl", "has_sig": false, "md5_digest": "b3f23eff0431eeccf3659d891d6800e5", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 6982, "upload_time": "2019-01-27T13:48:46", "url": "https://files.pythonhosted.org/packages/aa/3a/7d31e87e974efcc0822309a8d35c71680c3fa1a89f66db5968415e01ef52/jsonapi_simple-0.2.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0326921cbc9a616551c30945702cd2af", "sha256": "05f9670a9bdc8f58759453ba0de3778b48d6f16640a622f34c1f12a7a1c9f5cd" }, "downloads": -1, "filename": "jsonapi-simple-0.2.2.tar.gz", "has_sig": false, "md5_digest": "0326921cbc9a616551c30945702cd2af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5500, "upload_time": "2019-01-27T13:48:47", "url": "https://files.pythonhosted.org/packages/12/a9/c11572734f1e81bd39385ab42d5c6b059c22fee5ed04e44c8868d0d4c5fd/jsonapi-simple-0.2.2.tar.gz" } ] }