{ "info": { "author": "", "author_email": "info@sparkworks.net", "bugtrack_url": null, "classifiers": [], "description": "A client library for accessing data through the `SparkWorks Rest\nAPI `__.\n\nSparkWorks Rest API Python Client\n=================================\n\nThis Python package is automatically generated by the `Swagger\nCodegen `__ project:\n\n- API version: v2.0\n- Build package: io.swagger.codegen.languages.PythonClientCodegen For\n more information, please visit http://www.sparkworks.net/\n\nRequirements.\n-------------\n\nPython 2.7 and 3.4+\n\nInstallation & Usage\n--------------------\n\npip install\n~~~~~~~~~~~\n\n.. code:: sh\n\n pip install sparkworksrest\n\n(you may need to run ``pip`` with root permission:\n``sudo pip install sparkworksrest``)\n\nThen import the package:\n\n.. code:: python\n\n import sparkworks_client \n\nPython Client Documentation\n---------------------------\n\nDocumentation for the client can be found on\n`Github `__\n\nSetting up the access to the SparkWorks Rest API\n------------------------------------------------\n\n.. code:: python\n\n\n import sparkworks_client\n\n # Configure OAuth2 access token for authorization: oauth2\n configuration = sparkworks_client.Configuration(\"username\", \"password\", \"client_id\", \"client_secret\")\n configuration.connect()\n\n # create an instance of the API class\n api_client = sparkworks_client.ApiClient(configuration)\n\n #initialize the clients needed\n unit_api_instance = sparkworks_client.UnitApi(api_client)\n group_api_instance = sparkworks_client.GroupApi(api_client)\n phenomenon_api_instance = sparkworks_client.PhenomenonApi(api_client)\n gateway_api_instance = sparkworks_client.GatewayApi(api_client)\n resource_api_instance = sparkworks_client.ResourceApi(api_client)\n command_api_instance = sparkworks_client.CommandApi(api_client)\n registry_api_instance = sparkworks_client.RegistryApi(api_client)\n data_api_instance = sparkworks_client.DataApi(api_client)\n participatorySensing_api_instance = sparkworks_client.ParticipatorySensingApi(api_client)\n\nExamples\n--------\n\nExample 1: List Resources and Access Resource Data\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n import time\n\n import sparkworks_client\n\n # Configure OAuth2 access token for authorization: oauth2\n configuration = sparkworks_client.Configuration(\"username\", \"password\", \"client_id\", \"client_secret\")\n configuration.connect()\n print(\"access_token: \" + configuration.access_token)\n\n # create an instance of the API class\n\n api_client = sparkworks_client.ApiClient(configuration)\n\n resource_api_instance = sparkworks_client.ResourceApi(api_client)\n unit_api_instance = sparkworks_client.UnitApi(api_client)\n phenomenon_api_instance = sparkworks_client.PhenomenonApi(api_client)\n data_api_instance = sparkworks_client.DataApi(api_client)\n\n # list all Resources\n resources = resource_api_instance.get_resources()\n\n print \"====resource====\"\n # retrieve resource by uuid\n resource = resource_api_instance.get_resource_by_uuid(resources[0].uuid)\n print resource\n\n print \"====phenomenon====\"\n phenomenon = phenomenon_api_instance.get_phenomenon_by_uuid(resource.phenomenon_uuid)\n print phenomenon\n\n print \"====unit====\"\n unit = unit_api_instance.get_unit_by_uuid(resource.unit_uuid)\n print unit\n\n time_from = (int(round(time.time())) - 5 * 60 * 60) * 1000\n time_to = int(round(time.time())) * 1000\n\n print \"====data 5min====\"\n # retrieve data - granularity 5min\n data = data_api_instance.query_time_range({\n \"queries\": [\n {\n \"from\": time_from,\n \"to\": time_to,\n \"granularity\": \"5min\",\n \"resourceUuid\": resource.uuid\n }\n ]\n })\n\n for d in data.results.values():\n for datum in d.data:\n print \"5min\", datum\n\n print \"====data hour====\"\n # retrieve data - granularity hour\n data = data_api_instance.query_time_range({\n \"queries\": [\n {\n \"from\": time_from,\n \"to\": time_to,\n \"granularity\": \"hour\",\n \"resourceUuid\": resource.uuid\n }\n ]\n })\n\n for d in data.results.values():\n for datum in d.data:\n print \"hour\", datum\n\nExample 2: List Groups and Group Resources\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n import sparkworks_client\n\n # Configure OAuth2 access token for authorization: oauth2\n configuration = sparkworks_client.Configuration(\"username\", \"password\", \"client_id\", \"client_secret\")\n configuration.connect()\n print(\"access_token: \" + configuration.access_token)\n\n # create an instance of the API class\n\n api_client = sparkworks_client.ApiClient(configuration)\n\n resource_api_instance = sparkworks_client.ResourceApi(api_client)\n group_api_instance = sparkworks_client.GroupApi(api_client)\n\n print \"====groups====\"\n # list all groups\n groups = group_api_instance.get_all_groups()\n for group in groups:\n print group\n\n print \"====group[0].resources====\"\n # retrieve resources by group uuid\n resources = group_api_instance.get_group_resources(groups[0].uuid)\n for resource in resources:\n print resource\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://sparkworksnet.github.io/sparkworksrest/", "keywords": "Swagger", "license": "", "maintainer": "", "maintainer_email": "", "name": "sparkworksrest", "package_url": "https://pypi.org/project/sparkworksrest/", "platform": "", "project_url": "https://pypi.org/project/sparkworksrest/", "project_urls": { "Homepage": "https://sparkworksnet.github.io/sparkworksrest/" }, "release_url": "https://pypi.org/project/sparkworksrest/1.0.12/", "requires_dist": null, "requires_python": "", "summary": "A client library for the sparkworks rest api", "version": "1.0.12" }, "last_serial": 5923674, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "60c1b6727fef07eaa35c9706df244dea", "sha256": "e62a7ac846cec9d50c904c55579c3db3227ff21df6ee7e2eb2a782814bd7a0ce" }, "downloads": -1, "filename": "sparkworksrest-1.0.0.tar.gz", "has_sig": false, "md5_digest": "60c1b6727fef07eaa35c9706df244dea", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 18670, "upload_time": "2019-09-23T09:56:46", "url": "https://files.pythonhosted.org/packages/55/6f/7cd4a17d3e780efe60dce1ee226bf2ea24333959a58c433f84d4b6c23ff4/sparkworksrest-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "a38a9991a3a3335514c714f05b86aa84", "sha256": "df35907e92b344a99bd728cb201bf541838c8984e9528966a4983cd395c27af4" }, "downloads": -1, "filename": "sparkworksrest-1.0.1.tar.gz", "has_sig": false, "md5_digest": "a38a9991a3a3335514c714f05b86aa84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44430, "upload_time": "2019-09-23T10:06:07", "url": "https://files.pythonhosted.org/packages/23/fa/24383939aa702d24be6f5added79431b89123c355c3c849ac8eccfd09ab8/sparkworksrest-1.0.1.tar.gz" } ], "1.0.10": [ { "comment_text": "", "digests": { "md5": "e1af6b85e029cd7ac580cf4b62b0f3e4", "sha256": "389e008548a2899c9634dce45c2b5abf67e589969bd63ebb5546e667bafa7523" }, "downloads": -1, "filename": "sparkworksrest-1.0.10.tar.gz", "has_sig": false, "md5_digest": "e1af6b85e029cd7ac580cf4b62b0f3e4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 53274, "upload_time": "2019-09-27T14:27:09", "url": "https://files.pythonhosted.org/packages/eb/15/2a3ee383c44b370cdf6740a423a8bf5bef0ecd1e12e41f6be29f0a63dcaf/sparkworksrest-1.0.10.tar.gz" } ], "1.0.11": [ { "comment_text": "", "digests": { "md5": "c87b43408e4bfb87b008c1ae692e905c", "sha256": "f8ec97d4c2503948698842ec3dd9bab919a6d326a426c8541d995aafc107aaec" }, "downloads": -1, "filename": "sparkworksrest-1.0.11.tar.gz", "has_sig": false, "md5_digest": "c87b43408e4bfb87b008c1ae692e905c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 53401, "upload_time": "2019-09-27T14:29:40", "url": "https://files.pythonhosted.org/packages/6a/98/3cb363b08da349bf8a7747967c4ccab510c07a36d6dec7a1bc967bceb61b/sparkworksrest-1.0.11.tar.gz" } ], "1.0.12": [ { "comment_text": "", "digests": { "md5": "1b2d38204953be6d90e410970cd205ef", "sha256": "a16413848d10d8b3a2dbd6e3eccf63b178d9dd974dba1eee5d460d91e7b5f15a" }, "downloads": -1, "filename": "sparkworksrest-1.0.12.tar.gz", "has_sig": false, "md5_digest": "1b2d38204953be6d90e410970cd205ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 53442, "upload_time": "2019-10-03T14:07:16", "url": "https://files.pythonhosted.org/packages/85/d1/b7cb4337f543b6a3c4765d8eafcfa7904c0245140465ce33b31a35c90c90/sparkworksrest-1.0.12.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "88d0fcbff956be2616059ed857f04498", "sha256": "8017e0e639a4c414f4f0be03a4a6bf87850264c51d8071be7b222357866e059e" }, "downloads": -1, "filename": "sparkworksrest-1.0.2.tar.gz", "has_sig": false, "md5_digest": "88d0fcbff956be2616059ed857f04498", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48585, "upload_time": "2019-09-23T10:41:20", "url": "https://files.pythonhosted.org/packages/13/67/263857097d02620ea45f11e46c16afe9308a48e96f7a397f82ab2c6bba24/sparkworksrest-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "e9926ba5bd80a3985bcee3c20c13fd53", "sha256": "a387ea3c195719abc088976b20dd471dd85ae1d7a6d8762084ef22396030b862" }, "downloads": -1, "filename": "sparkworksrest-1.0.3.tar.gz", "has_sig": false, "md5_digest": "e9926ba5bd80a3985bcee3c20c13fd53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 48584, "upload_time": "2019-09-23T10:42:17", "url": "https://files.pythonhosted.org/packages/b1/be/f90dd861c3b2c4465f28139a5ca684a57043ac9f3ae74f72456e8a52cebb/sparkworksrest-1.0.3.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "03c172afc07b0f1064f888fe6f427a71", "sha256": "f7f743338568b49fd52fd2b6dcc3f7b6fa87cdbe4c05402072da679a9f463b46" }, "downloads": -1, "filename": "sparkworksrest-1.0.5.tar.gz", "has_sig": false, "md5_digest": "03c172afc07b0f1064f888fe6f427a71", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44598, "upload_time": "2019-09-23T10:45:12", "url": "https://files.pythonhosted.org/packages/ff/f8/36b109def1371c7361f7b1a0095efbb5fdea4030cbd8bbac7e3d64b9dbd6/sparkworksrest-1.0.5.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "4f8ec2892e18c1035f781b04db853d10", "sha256": "fef9157d5966ef3d0b138ad4dd68e0099d9c32815945d145312987d04ddd17a1" }, "downloads": -1, "filename": "sparkworksrest-1.0.6.tar.gz", "has_sig": false, "md5_digest": "4f8ec2892e18c1035f781b04db853d10", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44542, "upload_time": "2019-09-23T11:55:24", "url": "https://files.pythonhosted.org/packages/e9/f7/80a35a9b4c6a06570647c3eeda9135b4ed65bbad44086fd1e3f7dd79c32c/sparkworksrest-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "95e8ff178a05adce81b9c4447b040eda", "sha256": "7879c7584ca748405aeddf0a11e675e4efd011664847dd3ccff6bcccb9689de4" }, "downloads": -1, "filename": "sparkworksrest-1.0.7.tar.gz", "has_sig": false, "md5_digest": "95e8ff178a05adce81b9c4447b040eda", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46855, "upload_time": "2019-09-23T14:07:14", "url": "https://files.pythonhosted.org/packages/a6/a4/2c0abae8f8d52397e99f9835b1fab2082ddf20c96c105e7e337fadfad5ac/sparkworksrest-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "c637f1a9d60c2df9f04fb10606a0a854", "sha256": "9e1f9c4f2062a37fc43443e4122fadf564aebd816767267f029b1d02cc99ab90" }, "downloads": -1, "filename": "sparkworksrest-1.0.8.tar.gz", "has_sig": false, "md5_digest": "c637f1a9d60c2df9f04fb10606a0a854", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 46873, "upload_time": "2019-09-23T14:43:04", "url": "https://files.pythonhosted.org/packages/d7/8a/91948710d46c34b85e9a3c2ffe8d2467c8c72933ef78fdaf2631d97dde19/sparkworksrest-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "045ae9e099bb0ba0f4dca5d4c68b201a", "sha256": "d929d040ce3d89410c8491a014826a939f16cb7e5eb5038c52c1eb0d605ff83d" }, "downloads": -1, "filename": "sparkworksrest-1.0.9.tar.gz", "has_sig": false, "md5_digest": "045ae9e099bb0ba0f4dca5d4c68b201a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 44360, "upload_time": "2019-09-24T10:11:49", "url": "https://files.pythonhosted.org/packages/45/c7/1ba09460f2b09d2f751d6744c900a9547c4865d35aafb93701efd2328a85/sparkworksrest-1.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b2d38204953be6d90e410970cd205ef", "sha256": "a16413848d10d8b3a2dbd6e3eccf63b178d9dd974dba1eee5d460d91e7b5f15a" }, "downloads": -1, "filename": "sparkworksrest-1.0.12.tar.gz", "has_sig": false, "md5_digest": "1b2d38204953be6d90e410970cd205ef", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 53442, "upload_time": "2019-10-03T14:07:16", "url": "https://files.pythonhosted.org/packages/85/d1/b7cb4337f543b6a3c4765d8eafcfa7904c0245140465ce33b31a35c90c90/sparkworksrest-1.0.12.tar.gz" } ] }