{ "info": { "author": "JP Jorissen", "author_email": "jjorissen52@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Operating System :: OS Independent", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7" ], "description": " ::\n\n /$$$$$$$ /$$ /$$\n | $$__ $$ | $$ | $$\n | $$ \\ $$ /$$ /$$ /$$$$$$ | $$$$$$$ /$$$$$$ /$$$$$$$\n | $$$$$$$/| $$ | $$|_ $$_/ | $$__ $$ /$$__ $$| $$__ $$\n | $$____/ | $$ | $$ | $$ | $$ \\ $$| $$ \\ $$| $$ \\ $$\n | $$ | $$ | $$ | $$ /$$| $$ | $$| $$ | $$| $$ | $$\n | $$ | $$$$$$$ | $$$$/| $$ | $$| $$$$$$/| $$ | $$\n |__/ \\____ $$ \\___/ |__/ |__/ \\______/ |__/ |__/\n /$$ | $$\n | $$$$$$/\n \\______/\n /$$$$$$ /$$$$$$ /$$\n /$$__ $$ /$$__ $$ | $$\n | $$ \\ $$| $$ \\__/ /$$$$$$ /$$$$$$$ /$$$$$$$ /$$$$$$\n | $$ | $$| $$ /$$$$ /$$__ $$| $$__ $$ /$$__ $$ |____ $$\n | $$ | $$| $$|_ $$| $$$$$$$$| $$ \\ $$| $$ | $$ /$$$$$$$\n | $$/$$ $$| $$ \\ $$| $$_____/| $$ | $$| $$ | $$ /$$__ $$\n | $$$$$$/| $$$$$$/| $$$$$$$| $$ | $$| $$$$$$$| $$$$$$$\n \\____ $$$ \\______/ \\_______/|__/ |__/ \\_______/ \\_______/\n \\__/\n\n\n\nDescription\n------------\nA simple Python package to facilitate interactions with QGenda's REST API.\n\n\nOverview\n---------\nPython QGenda is a client library to interact with QGenda's REST API. It provides some nice things out of the box for\nyou like automatic authentication and authentication storage.\n\nOnly GET methods are implemented, so if you need to update/delete, you will have to extend the API to do so.\nOfficial QGenda API documentation can be found `here `__.\n\nInstallation\n-------------\n\n.. code:: bash\n\n pip install python-qgenda\n\nSetup\n------\nYou will need to have an API account for QGenda for any of this stuff to work, of course. You will\nwant to have a config file that looks something like this:\n\n ::\n\n [qgenda]\n company_key = YOUR-COMPANY-KEY\n username = API-USERNAME\n password = API-PASSWORD\n api_url = https://api.qgenda.com/\n documentation = http://restapi.qgenda.com\n api_version = v2\n ; you can use redis or memcached, but you\n ; don't have to use caching at all if you don't want to.\n cache_backend =\n cache_host = 127.0.0.1\n cache_port = 6379\n cache_lifetime = 600 ; in seconds\n debug = 0\n\nSimple Usage\n------------\n\nLogging In\n++++++++++\nYou can login manually to test your credentials, but this library keeps the client authenticated\nautomatically so you don\u2019t need to worry about it after you know your credentials work.\n\n.. code:: python\n\n import os\n\n # tell configparser where to look for config\n os.environ['QGENDA_CONF_FILE'] = '/path/to/qgenda.conf'\n # optional\n os.environ['QGENDA_CONF_REGION'] = 'name_of_region' # defaults to qgenda\n\n from qgenda.api import client\n client = client.QGendaClient()\n client.authenticate()\n\nBasics\n+++++++\nEvery method returns a Response object from the requests library, so it's up to you to handle the json (or errors) that\ncome out.\n\n.. code:: python\n\n import json\n\n odata_kwargs = {\"$select\": \"StartDate,EndDate,StaffLName\"}\n api_response = client.get_schedule(start_date='2019-01-01',\n odata_kwargs=odata_kwargs)\n # the response is now in a dictionary for easy consumption\n response_dict = json.loads(api_response.text)\n\n print(json.dumps(response_dict[0], indent=4))\n\nOutput\n ::\n\n {\n \"StaffLName\": \"Holmes K\",\n \"EndDate\": \"2019-01-01T00:00:00\",\n \"StartDate\": \"2019-01-01T00:00:00\"\n }\n\n\nGet Method Examples\n+++++++++++++++++++\nEach of the get methods has optional OData parameters available, which allow you to sort, filter,\nor limit what data you are pulling from the API. These are different for each of the get methods,\nso you will want to check the official `QGenda API docs `__ for more details on that.\n\nQGendaClient.get_schedule\n@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n.. code:: python\n\n # odata is completely optional, but pretty useful.\n\n odata_kwargs = {\n \"$select\": \"StartDate,EndDate,StaffLName\",\n \"$orderby\": \"StartDate\",\n \"$filter\": \"startswith(StaffLName, 'H')\"\n }\n api_response = client.get_schedule(start_date='2019-01-01',\n end_date='2019-01-14',\n odata_kwargs=odata_kwargs)\n\n response_dict = json.loads(api_response.text)\n print(json.dumps(response_dict[:2], indent=4))\n\nOutput\n ::\n\n [\n {\n \"StaffLName\": \"Holmes K\",\n \"EndDate\": \"2019-01-01T00:00:00\",\n \"StartDate\": \"2019-01-01T00:00:00\"\n },\n {\n \"StaffLName\": \"Hoover\",\n \"EndDate\": \"2019-01-01T00:00:00\",\n \"StartDate\": \"2019-01-01T00:00:00\"\n }\n ]\n\nQGendaClient.get_facility\n@@@@@@@@@@@@@@@@@@@@@@@@@\nAs of the writing of this guide, attempting to use odata on an empty request results in a Bad\nRequest response. You may need to keep that in mind as you work with the API.\n\n.. code:: python\n\n odata_kwargs = {\n '$select': 'Name,ID',\n }\n api_response = client.get_facility()\n response_dict = json.loads(api_response.text)\n # looks like there aren't any yet.\n print(json.dumps(response_dict[:2], indent=4))\n\nQGendaClient.get_timeevent\n@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n.. code:: python\n\n api_response = client.get_timeevent(start_date='2019-01-01')\n response_dict = json.loads(api_response.text)\n # looks like there aren't any yet.\n print(json.dumps(response_dict[:2], indent=4))\n\n\nQGendaClient.get_dailycase\n@@@@@@@@@@@@@@@@@@@@@@@@@@\n\n.. code:: python\n\n api_response = client.get_dailycase(start_date='2019-01-01')\n response_dict = json.loads(api_response.text)\n # looks like there aren't any yet.\n print(json.dumps(response_dict[:2], indent=4))\n\n\nAdvanced\n--------\n\nCaching Authentication\n+++++++++++++++++++++++\nThe client saves its authentication token in cache so you don't need to re-authenticate between instances unless your token\nexpires. redis and python-memcached are currently the only supported cache backends. Using the below configuration\n\nRedis\n@@@@@@\n\nYou need to install redis in your environment and run a redis server.\n\n.. code:: bash\n\n pip install redis\n\nConfig\n ::\n\n [qgenda]\n company_key = YOUR-COMPANY-KEY\n username = API-USERNAME\n password = API-PASSWORD\n api_url = https://api.qgenda.com/\n documentation = http://restapi.qgenda.com\n api_version = v2\n cache_backend = redis\n cache_host = 127.0.0.1\n cache_port = 6379\n cache_lifetime = 600 ; in seconds\n debug = 0\n\nMemcached\n@@@@@@@@@@@\n\nYou need to install python-memecached in your environment and run a memcached server.\n\n.. code:: bash\n\n pip install python-memcached\n\nConfig\n ::\n\n [qgenda]\n company_key = YOUR-COMPANY-KEY\n username = API-USERNAME\n password = API-PASSWORD\n api_url = https://api.qgenda.com/\n documentation = http://restapi.qgenda.com\n api_version = v2\n cache_backend = memcached\n cache_host = 127.0.0.1\n cache_port = 11211\n cache_lifetime = 600 ; in seconds\n debug = 0\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/jjorissen52/python-qgenda", "keywords": "QGenda", "license": "Apache", "maintainer": "", "maintainer_email": "", "name": "python-qgenda", "package_url": "https://pypi.org/project/python-qgenda/", "platform": "", "project_url": "https://pypi.org/project/python-qgenda/", "project_urls": { "Homepage": "https://github.com/jjorissen52/python-qgenda" }, "release_url": "https://pypi.org/project/python-qgenda/1.0.dev5/", "requires_dist": null, "requires_python": "", "summary": "Python client for QGenda REST API", "version": "1.0.dev5" }, "last_serial": 5585368, "releases": { "1.0.dev0": [ { "comment_text": "", "digests": { "md5": "eb3eee20b9e45c4606368de063437c7a", "sha256": "a10837201c81380e6a8280342da486abc6b40b3a464b004c8003a5efa11e8f8e" }, "downloads": -1, "filename": "python-qgenda-1.0.dev0.tar.gz", "has_sig": false, "md5_digest": "eb3eee20b9e45c4606368de063437c7a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9987, "upload_time": "2018-10-04T13:53:26", "url": "https://files.pythonhosted.org/packages/5e/17/e5cceaa9959ad9fadfa28e43e2a91f3b548b98184e8af2557d7423acc089/python-qgenda-1.0.dev0.tar.gz" } ], "1.0.dev1": [ { "comment_text": "", "digests": { "md5": "f4ab9873d054d89cf64ec854fe2b2d5a", "sha256": "2a756e012cdf72e702fcc7c6056c34c01355c05b2c1dd51c2f65d61d8cb109dc" }, "downloads": -1, "filename": "python-qgenda-1.0.dev1.tar.gz", "has_sig": false, "md5_digest": "f4ab9873d054d89cf64ec854fe2b2d5a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10834, "upload_time": "2018-10-04T18:44:32", "url": "https://files.pythonhosted.org/packages/36/ee/9f1908c86a352c5446e8572febde0474e3d404fcdbc1f37b44dfe8089f10/python-qgenda-1.0.dev1.tar.gz" } ], "1.0.dev2": [ { "comment_text": "", "digests": { "md5": "1ce1bf60f7de301de3edde9e4082b7af", "sha256": "e3f7ad7b8cd4e569ba6a865e272cb26b6888ef47908a79e4e759669c3abf4fd4" }, "downloads": -1, "filename": "python-qgenda-1.0.dev2.tar.gz", "has_sig": false, "md5_digest": "1ce1bf60f7de301de3edde9e4082b7af", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10797, "upload_time": "2018-10-04T18:53:09", "url": "https://files.pythonhosted.org/packages/fd/02/cd401c84db9b51e09f32a8a570658e6bb460dfe4cd7be153c4d8d04add75/python-qgenda-1.0.dev2.tar.gz" } ], "1.0.dev3": [ { "comment_text": "", "digests": { "md5": "b394355f580ceafbe78a3a61bc27dd6d", "sha256": "d03092a055154222b3ff8dd11bd093c1df588628419ba57260eb8918b6118846" }, "downloads": -1, "filename": "python-qgenda-1.0.dev3.tar.gz", "has_sig": false, "md5_digest": "b394355f580ceafbe78a3a61bc27dd6d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10731, "upload_time": "2018-10-04T19:15:19", "url": "https://files.pythonhosted.org/packages/02/c1/f93d59fad786744efba7b4b4e490f74732e3bbfd2f86132a8f6603fa39a2/python-qgenda-1.0.dev3.tar.gz" } ], "1.0.dev4": [ { "comment_text": "", "digests": { "md5": "a1ae4b32a245eaf4c0fd0b011250e83a", "sha256": "59aa239ae2385b6595dccdfff9afa2444bf53033edfbf0adb05447151cf7e7bf" }, "downloads": -1, "filename": "python-qgenda-1.0.dev4.tar.gz", "has_sig": false, "md5_digest": "a1ae4b32a245eaf4c0fd0b011250e83a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12988, "upload_time": "2019-01-22T17:00:39", "url": "https://files.pythonhosted.org/packages/6e/dd/bc87581eebe60bc9ebaa564691ef27c154a91986fe69220e3ac3f4235faa/python-qgenda-1.0.dev4.tar.gz" } ], "1.0.dev5": [ { "comment_text": "", "digests": { "md5": "c8b4b0a2b0658d77af886372ecc31db1", "sha256": "e5992a36998327286c70ac47bd02b8df8e2ea7576b23409189d38fa208b18b64" }, "downloads": -1, "filename": "python-qgenda-1.0.dev5.tar.gz", "has_sig": false, "md5_digest": "c8b4b0a2b0658d77af886372ecc31db1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11659, "upload_time": "2019-07-25T19:58:29", "url": "https://files.pythonhosted.org/packages/b0/85/3cf9d899a7451310c21bae557150831e560192e519f9cf12edba2f5ed93d/python-qgenda-1.0.dev5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c8b4b0a2b0658d77af886372ecc31db1", "sha256": "e5992a36998327286c70ac47bd02b8df8e2ea7576b23409189d38fa208b18b64" }, "downloads": -1, "filename": "python-qgenda-1.0.dev5.tar.gz", "has_sig": false, "md5_digest": "c8b4b0a2b0658d77af886372ecc31db1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11659, "upload_time": "2019-07-25T19:58:29", "url": "https://files.pythonhosted.org/packages/b0/85/3cf9d899a7451310c21bae557150831e560192e519f9cf12edba2f5ed93d/python-qgenda-1.0.dev5.tar.gz" } ] }