{ "info": { "author": "Diogo Magalh\u00e3es Martins", "author_email": "magalhaesmartins@icloud.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "Intended Audience :: Education", "License :: Public Domain", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: Dynamic Content", "Topic :: Software Development :: Libraries" ], "description": "API\n===\n\n|PyPi version| |Py versions|\n\nPython module for the API provided by the Universidade Federal do Estado\ndo Rio de Janeiro (UNIRIO) Please visit http://sistemas.unirio.br/api\nfor futher information.\n\nInstalling\n----------\n\n::\n\n pip install unirio-api\n\nFile Structure\n--------------\n\n.. code:: text\n\n api/\n \u251c\u2500\u2500 MANIFEST.in\n \u251c\u2500\u2500 README.md\n \u251c\u2500\u2500 README.rst\n \u251c\u2500\u2500 __init__.py\n \u251c\u2500\u2500 requirements.txt\n \u251c\u2500\u2500 setup.cfg\n \u251c\u2500\u2500 setup.py\n \u251c\u2500\u2500 tests\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 __init__.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 config.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 delete.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 get.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 post.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 procedures.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 put.py\n \u2502\u00a0\u00a0 \u251c\u2500\u2500 request.py\n \u251c\u2500\u2500 unirio\n \u00a0\u00a0 \u251c\u2500\u2500 __init__.py\n \u00a0\u00a0 \u2514\u2500\u2500 api\n \u00a0\u00a0 \u251c\u2500\u2500 __init__.py\n \u00a0\u00a0 \u251c\u2500\u2500 exceptions.py\n \u00a0\u00a0 \u251c\u2500\u2500 request.py\n \u00a0\u00a0 \u251c\u2500\u2500 request.pyi\n \u00a0\u00a0 \u251c\u2500\u2500 result.py\n\nTests\n-----\n\n|Build Status| |codecov|\n\n::\n\n python -m unittest -v tests\n\nUNIRIOAPIRequest\n----------------\n\nUNIRIOAPIRequest takes 2 arguments:\n\n- A valid APIKey that will be used for future requests\n- An APIServer that identify the server used to perform the requests\n- An integer identifier for the server used to perform requests.\n Default: ``APIServer.LOCAL`` (Local Server)\n\nThe Methods\n-----------\n\nThe public module interface for interacting with the API methods is as\nfollows:\n\n.. code:: python\n\n def get(self, path: str, params: Dict[str:Any], fields: list, cache_time: int) -> APIResultObject:\n\n- path: The API endpoint to use for the request, for example 'ALUNOS'\n- params: The parameters for the request. A value of None sends the\n automatic API parameters\n- fields: The return fields for the request. A value of None is equal\n do requesting ALL the fields\n\n.. code:: python\n\n def post(self, path: str, params: Dict[str:Any]) -> APIPOSTResponse:\n\n- path: The API endpoint to use for the request, for example 'ALUNOS'\n- params: The parameters for the request. Should contain all the\n not-null attributes.\n\n.. code:: python\n\n def delete(self, path: str, params: Dict[str:int]) -> APIDELETEResponse:\n\n- path: The API endpoint to use for the request, for example 'ALUNOS'\n- params: The parameters for the request. Should contain the endpoint\n unique identifier. e.g.: ``{'ID_ALUNO': 235}``\n\n.. code:: python\n\n def put(self, path: str, params: Dict[str:Any]) -> APIPUTResponse:\n\n- path: The API endpoint to use for the request, for example 'ALUNOS'\n- params: The parameters for the request. Should contain all the\n attributes that should be updated as well as the endpoint unique\n identifier.\n\nUsage\n-----\n\nOn your models, import ``UNIRIOAPIRequest`` and the enum ``APIServer``\nand create an api object using your APIKey provided by\nhttp://sistemas.unirio.br/api\n\n.. code:: python\n\n from unirio.api import UNIRIOAPIRequest, APIServer\n\n api_key = 'afakehashusedforthisexample'\n api = UNIRIOAPIRequest(api_key, APIServer.PRODUCTION)\n\nOptional parameters are ``debug: boolean`` and ``cache``. ``debug``\ngives console verbosity and ``cache`` is used for caching in\n``UNIRIOAPIRequest.get`` method.\n\nget\n~~~\n\n.. code:: python\n\n path = 'ALUNOS'\n params = {\n 'LMIN' : 0,\n 'LMAX' : 1000,\n 'SEXO' : 'F'\n 'ETNIA_ITEM' : 1\n }\n fields = ['ID_ALUNO', 'ID_PESSOA', 'SEXO']\n result = api.get(path, params, fields) # type: unirio.api.result.APIRestultObject\n\nThe get method also have an optional parameter ``cache_time``,\nrepresenting the cache expiration time in seconds, and defaults to\n``0``, that means that no cache is applied.\n\n.. code:: python\n\n [...] \n result = api.get(path, params, fields, cache_time=60)\n\nThe above request gives the same response object, but is cached for 60\nseconds, wich means that if another request is made within 60 seconds,\nfor the same ``path``, another HTTP request wont be made to the API\nserver.\n\n **All the caching is done on the client side**, wich means that\n every request done to the api will always reflect the current state\n of the resource at the time of the request. Whenever possible, it's\n always recommended that you cache your requests, since in most cases\n it's much faster.\n\nA method call to ``UNIRIOAPIRequest.get`` will return an\n``APIResultObject`` wich is a model object and have the following\nattributes:\n\n- ``content: list``: A list of dictionaries with the result of the GET\n request. If ``fields != None`` the dictionaries of the list will only\n contain the keys from the ``fields`` list.\n- ``lmin: int``: The offset of the request result\n- ``lmax: int``: The limit of the request result\n- ``fields: tuple``: The list of endpoint fields that should be\n returned\n\nExceptions\n^^^^^^^^^^\n\n- ``NoContentException``: Raised when the api returns a 'content not\n found' status code, and it means that no content was found for the\n given parameters.\n\n- \n\npost\n~~~~\n\n.. code:: python\n\n path = 'ALUNOS'\n params = {\n 'SEXO': 'F',\n 'ETNIA_ITEM': 1,\n 'NOME_PAI': 'Jonathan Kent',\n 'NOME_MAE': 'Martha Kent'\n 'ID_PESSOA': 345\n }\n result = api.post(path, params) # type: unirio.api.result.APIPOSTResponse\n\nA method call to ``UNIRIOAPIRequest.post`` will return an\n``APIPOSTResponse`` wich is a model object and have the following\nattributes:\n\n- ``insertId: int``: Unique identifier created on the POST request.\n\nExceptions\n^^^^^^^^^^\n\n- ``InvalidParametersException``:\n- ``ContentNotCreated``:\n\n- \n\nput\n~~~\n\n.. code:: python\n\n path = 'PESSOAS'\n params = {\n 'ID_PESSOA': 345,\n 'NOME_PESSOA': 'My new name'\n }\n result = api.put(path, params) # type: unirio.api.result.APIPUTResponse\n\nA method call to ``UNIRIOAPIRequest.put`` will return an\n``APIPUTResponse`` wich is a model object and have the following\nattributes:\n\n- ``affectedRows: int``: The number of rows affected by the PUT\n request.\n\nExceptions\n^^^^^^^^^^\n\n- ``ContentNotFoundException``: Invalid unique identifier and nothing\n was updated\n- ``InvalidParametersException``: One or more of the parameters has an\n incompatible type\n- ``NothingToUpdateException``: No valid content passed on ``params``\n and nothing was updated\n- ``MissingPrimaryKeyException``: The unique identifier field isn't a\n Key in the ``params`` dictionary.\n\ndelete\n~~~~~~\n\n.. code:: python\n\n path = 'PESSOAS'\n params = {'ID_PESSOA': 345}\n result = api.delete(path, params) # type: unirio.api.result.APIDELETEResponse\n\nA method call to ``UNIRIOAPIRequest.delete`` will return an\n``APIDELETEResponse`` wich is a model object and have the following\nattributes:\n\n- ``affectedRows: int``: The number of rows affected by the DELETE\n request.\n\nExceptions\n^^^^^^^^^^\n\n- ``ContentNotFoundException``: Invalid unique identifier and nothing\n was updated\n- ``NothingToUpdateException``:\n- ``MissingPrimaryKeyException``: The unique identifier field isn't a\n Key in the ``params`` dictionary.\n\nCommon Exceptions\n~~~~~~~~~~~~~~~~~\n\n- ``ForbiddenEndpointException``: The API Key doens't have permission\n to perform the request on the ``path`` endpoint\n- ``InvalidAPIKeyException``: The API Key used is invalid or inactive\n- ``UnhandledAPIException``: Something unexpected happened on the\n server side\n- ``InvalidEndpointException``: The endpoint ``path`` doesn't exist.\n Check the list of endpoint on the main page of\n http://sistemas.unirio.br/api\n- ``InvalidParametersException``: The request was performed with\n invalid ``params`` and shouldn't be repeated used the same\n ``params``. That exception object has an ``invalid_parameters``\n attribute, wich is a list of the invalid keys on ``params``\n dictionary.\n\nCache\n-----\n\nTodo: Should explain the necessary interface that the cache object\nshould have to comply with the api cache duck typing, as well as its\nusage\n\n- For default value references, check the API documentation.\n\n.. |PyPi version| image:: https://img.shields.io/pypi/v/unirio-api.svg\n.. |Py versions| image:: https://img.shields.io/pypi/pyversions/unirio-api.svg\n.. |Build Status| image:: https://img.shields.io/travis/unirio-dtic/api_client/master.svg?style=flat-square&label=Travis-CI\n :target: https://travis-ci.org/unirio-dtic/api_client\n.. |codecov| image:: https://codecov.io/gh/unirio-dtic/api_client/branch/master/graph/badge.svg\n :target: https://codecov.io/gh/unirio-dtic/api_client", "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/unirio-dtic/api_client", "keywords": "unirio api rest sie development", "license": "GPLv2", "maintainer": null, "maintainer_email": null, "name": "unirio-api", "package_url": "https://pypi.org/project/unirio-api/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/unirio-api/", "project_urls": { "Download": "UNKNOWN", "Homepage": "https://github.com/unirio-dtic/api_client" }, "release_url": "https://pypi.org/project/unirio-api/1.1.1/", "requires_dist": null, "requires_python": null, "summary": "Client package for the RESTful api provided by the Universidade Federal do Estado do Rio de Janeiro (UNIRIO)", "version": "1.1.1" }, "last_serial": 2204382, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c45b3b2c1edd5d8da499700245f4099e", "sha256": "75544c18de132d14deb66604f434a4768187176d29a2c0425af3fb4e0f3c7f30" }, "downloads": -1, "filename": "unirio_api-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "c45b3b2c1edd5d8da499700245f4099e", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13386, "upload_time": "2016-05-31T15:40:13", "url": "https://files.pythonhosted.org/packages/f8/e6/920cccdda0b3bc2bbdfb7e4c3ca2c1ac863c4de6c1c846992a0331a93436/unirio_api-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "564a748dc3e8186412e120adb3c304f4", "sha256": "4b394fd628b221afb04f88e80ab571ba11688f66a5d82ea96a01714ddc172bb9" }, "downloads": -1, "filename": "unirio_api-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "564a748dc3e8186412e120adb3c304f4", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 13524, "upload_time": "2016-05-31T16:06:03", "url": "https://files.pythonhosted.org/packages/e4/39/64ff264d87ae904b5aed56d5e75b515798101e6c14616fee3b7afbde87e8/unirio_api-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "3ff976253d66409ed779a159398f02de", "sha256": "c073f615e4ba4a12e0f7d8db6e56536d88f0726593bdb5ac2c2eb795c6897658" }, "downloads": -1, "filename": "unirio-api-1.0.0.tar.gz", "has_sig": false, "md5_digest": "3ff976253d66409ed779a159398f02de", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11524, "upload_time": "2016-05-31T15:39:31", "url": "https://files.pythonhosted.org/packages/16/fa/62a8d7695219302849aba98eac84aab892598be9c1ef553a550118443da5/unirio-api-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "8c4c7f534b04439ca19254046986ae86", "sha256": "9b68c53231e6d321de55fb291de4e805c605e9307dde2c1c50961c18d618463b" }, "downloads": -1, "filename": "unirio-api-1.0.1.tar.gz", "has_sig": false, "md5_digest": "8c4c7f534b04439ca19254046986ae86", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11740, "upload_time": "2016-05-31T16:33:38", "url": "https://files.pythonhosted.org/packages/75/67/e3b8778f9b91f901fcde61871d6cf40a652279711be9d7d594359f02a0cc/unirio-api-1.0.1.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "db10d72e7fae7ed2e3c3302358165a78", "sha256": "60ef79b82cc9e0cc1bdee1f145ac791d3f308afd6af7314ba24c950959cb33ec" }, "downloads": -1, "filename": "unirio-api-1.0.2.tar.gz", "has_sig": false, "md5_digest": "db10d72e7fae7ed2e3c3302358165a78", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11823, "upload_time": "2016-05-31T16:52:10", "url": "https://files.pythonhosted.org/packages/8e/a9/6d615b2bbd3ac01822960c773f15565555aa12e86b61dc968db1ced4ab97/unirio-api-1.0.2.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "9a76f86a0e8fc5cac99d4292a47c6805", "sha256": "1e1999b319a315b0624e5ac1b0acb2e48a12a299780684f05e5c06512fbd42bb" }, "downloads": -1, "filename": "unirio-api-1.1.0.tar.gz", "has_sig": false, "md5_digest": "9a76f86a0e8fc5cac99d4292a47c6805", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12647, "upload_time": "2016-07-05T18:34:31", "url": "https://files.pythonhosted.org/packages/28/24/38a01d212f2b4e543aab0ee7b3a0a59c9e73384d954342ec66953455bf6f/unirio-api-1.1.0.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "ac0e837e0ed362ec3ce8bf4c5ea95095", "sha256": "32acefc651f794de8645e52a75f85042178c7198366b0884768cab06dc545dfd" }, "downloads": -1, "filename": "unirio_api-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ac0e837e0ed362ec3ce8bf4c5ea95095", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 14417, "upload_time": "2016-07-05T20:28:16", "url": "https://files.pythonhosted.org/packages/5c/0c/3795dd8d842bd3fb76148057ee7b4d3c13eb0a088ff5ccfb89a1cbceda1d/unirio_api-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2c35e4405c3562b017d495158819bcc", "sha256": "5b427e7b3d240bd9aa1e0de98b080a17871aef33a2a7b2c3b1cac2132699ce02" }, "downloads": -1, "filename": "unirio-api-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b2c35e4405c3562b017d495158819bcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12589, "upload_time": "2016-07-05T20:28:11", "url": "https://files.pythonhosted.org/packages/e3/47/d3305e26937c9e83022e44049864ae0afa261e59ec224d3655239ceef5a5/unirio-api-1.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ac0e837e0ed362ec3ce8bf4c5ea95095", "sha256": "32acefc651f794de8645e52a75f85042178c7198366b0884768cab06dc545dfd" }, "downloads": -1, "filename": "unirio_api-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ac0e837e0ed362ec3ce8bf4c5ea95095", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 14417, "upload_time": "2016-07-05T20:28:16", "url": "https://files.pythonhosted.org/packages/5c/0c/3795dd8d842bd3fb76148057ee7b4d3c13eb0a088ff5ccfb89a1cbceda1d/unirio_api-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2c35e4405c3562b017d495158819bcc", "sha256": "5b427e7b3d240bd9aa1e0de98b080a17871aef33a2a7b2c3b1cac2132699ce02" }, "downloads": -1, "filename": "unirio-api-1.1.1.tar.gz", "has_sig": false, "md5_digest": "b2c35e4405c3562b017d495158819bcc", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12589, "upload_time": "2016-07-05T20:28:11", "url": "https://files.pythonhosted.org/packages/e3/47/d3305e26937c9e83022e44049864ae0afa261e59ec224d3655239ceef5a5/unirio-api-1.1.1.tar.gz" } ] }