{ "info": { "author": "Julio M Alegria", "author_email": "julio@amigocloud.com", "bugtrack_url": null, "classifiers": [], "description": "python-amigocloud\n=================\n\nPython client for the `AmigoCloud `__ REST\nAPI.\n\nInstallation\n------------\n\nInstall via pip:\n\n::\n\n pip install amigocloud\n\nDependencies\n------------\n\n- |requests|_: Handles the HTTP requests to the AmigoCloud REST API.\n- |socketIO_client|_: Handles the AmigoCloud websocket connection.\n\nThis dependencies will be automatically installed.\n\nUsage\n-----\n\nAuthentication\n~~~~~~~~~~~~~~\n\nThis library uses API token to authenticate you. To generate or access your API tokens, go to `API tokens `__.\n\n.. code:: python\n\n from amigocloud import AmigoCloud\n amigocloud = AmigoCloud(token='R:dlNDEiOWciP3y26kG2cHklYpr2HIPK40HD32r1')\n\nYou could also use a project token. Remember that project tokens can only be used to query endpoints relative to the project it belongs to.\nIf the project URL doesn't match its project, `AmigoCloudError` will be thrown.\n\n.. code:: python\n\n from amigocloud import AmigoCloud\n amigocloud = AmigoCloud(token='C:Ndl3xGWeasYt9rqyuVsByf5HPMAGyte10y1Mub',\n project_url='users/123/projects/1234')\n\n\nYou can use a READ token if you only want to do requests that won't alter data. Otherwise, you'll need to use more permissive tokens.\n\nRequests\n~~~~~~~~\n\nOnce you're logged in you can start making requests to the server. You\ncan use full urls or relative API urls:\n\n.. code:: python\n\n # All three will do the same request:\n amigocloud.get('me')\n amigocloud.get('/me')\n amigocloud.get('https://www.amigocloud.com/api/v1/me')\n\nFor convenience, when using project tokens, urls are relative to the project's url (unless it starts with `/`):\n\n.. code:: python\n\n # All three will do the same request:\n amigocloud.get('datasets')\n amigocloud.get('/users/123/projects/1234/datasets')\n amigocloud.get('https://www.amigocloud.com/api/v1/users/123/projects/1234/datasets')\n\nCreating a new AmigoCloud project from Python is as simple as:\n\n.. code:: python\n\n data = {'name': 'New Project', 'description': 'Created from Python'}\n amigocloud.post('me/projects', data)\n\nAll responses are parsed as JSON and return a Python object (usually a\n``dict``). This data can be later used in another request:\n\n.. code:: python\n\n me = amigocloud.get('me')\n visible_projects = amigocloud.get(me['visible_projects'])\n\n print 'My projects:'\n for project in visible_projects['results']:\n print '*', project['name']\n\nYou can get the raw response if you want by using the ``raw`` parameter:\n\n.. code:: python\n\n me = amigocloud.get('me')\n images = amigocloud.get(me['images'])\n\n with open('thumbnail.png', 'wb') as thumbnail:\n image_data = amigocloud.get(images['thumbnail'], raw=True)\n thumbnail.write(image_data)\n\nWebsocket connection\n~~~~~~~~~~~~~~~~~~~~\n\nThe websocket connection is started when the AmigoCloud object is\ninstantiated, and it is closed when the object is destroyed. You always\nneed to use a user token for websockets.\n\nMake sure to read `our help page about our websocket events `__ before continue reading.\n\nTo start listening to websocket events related to your user (multicast\nevents), do (you must be logged in to start listening to your events):\n\n.. code:: python\n\n amigocloud.listen_user_events()\n\nOnce you're listening to your events, you can start adding callbacks to\nthem. A callback is a function that will be called everytime the event\nis received. These functions should have only one parameter, that would be a python dict.\n\n.. code:: python\n\n def project_created(data):\n print 'User id=%(user_id)s created project id=%(project_id)s' % data\n amigocloud.add_callback('project:creation_succeeded', project_created)\n\nRealtime events are broadcast events related to realtime dataset. To start listening to them, do:\n\n.. code:: python\n\n amigocloud.listen_dataset_events(owner_id, project_id, dataset_id)\n\nThen add a callback for them:\n\n.. code:: python\n\n def realtime(data):\n print 'Realtime dataset id=%(dataset_id)s' % data\n for obj in data['data']:\n print \"Object '%(object_id)s' is now at (%(latitude)s, %(longitude)s)\" % obj\n amigocloud.add_callback('realtime', realtime)\n\nFinally, start running the websocket client:\n\n.. code:: python\n\n ac.start_listening()\n\nThis method receives an optional parameter ``seconds``. If ``seconds``\nis ``None`` (default value), the client will listen forever. You might\nwant to run this method in a new thread.\n\nExceptions\n~~~~~~~~~~\n\nAn ``AmigoCloudError`` exception will be raised if anything fails during\nthe request:\n\n.. code:: python\n\n try:\n amigocloud.post('me/projects')\n except AmigoCloudError as err:\n print 'Something failed!'\n print 'Status code was', err.response.status_code\n print 'Message from server was', err.text\n\n.. |requests| replace:: ``requests``\n.. _requests: http://docs.python-requests.org/en/latest\n.. |socketIO_client| replace:: ``socketIO_client``\n.. _socketIO_client: https://github.com/invisibleroads/socketIO-client", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/amigocloud/python-amigocloud/tarball/1.2.2", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/amigocloud/python-amigocloud", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "amigocloud", "package_url": "https://pypi.org/project/amigocloud/", "platform": "", "project_url": "https://pypi.org/project/amigocloud/", "project_urls": { "Download": "https://github.com/amigocloud/python-amigocloud/tarball/1.2.2", "Homepage": "https://github.com/amigocloud/python-amigocloud" }, "release_url": "https://pypi.org/project/amigocloud/1.2.2/", "requires_dist": null, "requires_python": "", "summary": "Python client for the AmigoCloud REST API", "version": "1.2.2" }, "last_serial": 5913997, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "aa171790b0d92329e95db1ae9e11897b", "sha256": "ed88205c08656fb70cd11a830bc58ee22cf24e458d9a428b70eb4629cf0dec7e" }, "downloads": -1, "filename": "amigocloud-1.0.0.tar.gz", "has_sig": false, "md5_digest": "aa171790b0d92329e95db1ae9e11897b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4493, "upload_time": "2014-10-16T01:09:32", "url": "https://files.pythonhosted.org/packages/db/d6/1c7f5cb399995c395d5de33573c58e73bdb47b1dd2bc58d619c2d1abb101/amigocloud-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "2f04d52273a88195e5d5efcbbfa37536", "sha256": "7f4ea35fd4d32d0071fd03ca3d3d7934dda9d35ab4543e12c7fc4cf6eed5524a" }, "downloads": -1, "filename": "amigocloud-1.0.1.tar.gz", "has_sig": false, "md5_digest": "2f04d52273a88195e5d5efcbbfa37536", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4099, "upload_time": "2014-10-16T00:52:28", "url": "https://files.pythonhosted.org/packages/a6/db/5c754de82edd16f6cdb5e6b8acf6e667bcc980a9e3aec09c228561ed2f2d/amigocloud-1.0.1.tar.gz" } ], "1.0.10": [ { "comment_text": "", "digests": { "md5": "a91124fa35abfe362b19ce599bb67f67", "sha256": "3ff755b554c30bc5028bd0e6a7821e39fecddbfd7ad7af8ba5016f17cfc9b4a0" }, "downloads": -1, "filename": "amigocloud-1.0.10.tar.gz", "has_sig": false, "md5_digest": "a91124fa35abfe362b19ce599bb67f67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10508, "upload_time": "2015-07-17T04:03:14", "url": "https://files.pythonhosted.org/packages/b7/a2/0f43e71425262cc1106569df261d7e2a6adfe2a973aeaab41f1bd17f0f44/amigocloud-1.0.10.tar.gz" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "88d417cfc2a3761d0c086bb1f10869ac", "sha256": "4c0a15153716fa3eceb664ba6ea98b83f61c7d19596501cc8d23ee4f4f7fb762" }, "downloads": -1, "filename": "amigocloud-1.0.2.tar.gz", "has_sig": false, "md5_digest": "88d417cfc2a3761d0c086bb1f10869ac", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7914, "upload_time": "2014-10-16T05:02:36", "url": "https://files.pythonhosted.org/packages/f1/4d/30fa55ed199da5c52ffbdb0a3e7fded159d1edcc32025dd4653a05f05b09/amigocloud-1.0.2.tar.gz" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "b36c487690b37e8b525b3778f83794c0", "sha256": "d7e4435f1e25e1c8c41071451f6505f59af12543f0fc429ab115587a56b88a4b" }, "downloads": -1, "filename": "amigocloud-1.0.3.tar.gz", "has_sig": false, "md5_digest": "b36c487690b37e8b525b3778f83794c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7883, "upload_time": "2014-10-25T17:51:41", "url": "https://files.pythonhosted.org/packages/19/5e/e60607fb2ca87f1c9a5c44ff97f545d03db32da6efe2c7c361e26106a54a/amigocloud-1.0.3.tar.gz" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "35ebd565a48c00d441c4c963c4a93eca", "sha256": "ed0247915c95993eecce054f6e01207163d06eacb8ec3721514d0f13ea41ff1a" }, "downloads": -1, "filename": "amigocloud-1.0.4.tar.gz", "has_sig": false, "md5_digest": "35ebd565a48c00d441c4c963c4a93eca", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8249, "upload_time": "2014-10-25T18:06:39", "url": "https://files.pythonhosted.org/packages/1a/aa/24b6fa493550a8e4b31f4849b2a472983cf487601ed0745b7e0b61808728/amigocloud-1.0.4.tar.gz" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "0ca0ed0de1c00a416efdfee067393750", "sha256": "c6dc4147b5842c5a88f18e09abb8a03046d335fd433452b20e88c9de7b179f75" }, "downloads": -1, "filename": "amigocloud-1.0.6.tar.gz", "has_sig": false, "md5_digest": "0ca0ed0de1c00a416efdfee067393750", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8339, "upload_time": "2015-03-17T18:30:26", "url": "https://files.pythonhosted.org/packages/58/25/e950c541141ec1f9b3f0792157e84dce5e3ea400fd41bb8fea87156c4847/amigocloud-1.0.6.tar.gz" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "080adc1b00cb6c883a0875ef840558cb", "sha256": "fc6f6e6d0459d160a752dd20cd29149895c4e4ea9a90657f0e0e546f61fc1c1c" }, "downloads": -1, "filename": "amigocloud-1.0.7.tar.gz", "has_sig": false, "md5_digest": "080adc1b00cb6c883a0875ef840558cb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8397, "upload_time": "2015-04-07T23:30:14", "url": "https://files.pythonhosted.org/packages/a8/cc/65ea5116959ad2ab1121e5be3f96db6d3646f50e422466fc1531fbccb640/amigocloud-1.0.7.tar.gz" } ], "1.0.8": [ { "comment_text": "", "digests": { "md5": "328ac96c6c2f6305d50906511d62de19", "sha256": "4e72b466289f85fceb25f9b9d1f82890a44980d9be6463d96710f85b59b63361" }, "downloads": -1, "filename": "amigocloud-1.0.8.tar.gz", "has_sig": false, "md5_digest": "328ac96c6c2f6305d50906511d62de19", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 990728, "upload_time": "2015-04-08T05:00:32", "url": "https://files.pythonhosted.org/packages/ea/ae/6bff155b33cef4e528689f01febf09ae9c5ee6714d9da3749718b763b9b3/amigocloud-1.0.8.tar.gz" } ], "1.0.9": [ { "comment_text": "", "digests": { "md5": "720f0e5a6102f6add19b8b05b5c09647", "sha256": "1dfd3081afee644b9d3059c50e275ca71d683c173bbe5190db2a42ae6d282072" }, "downloads": -1, "filename": "amigocloud-1.0.9.tar.gz", "has_sig": false, "md5_digest": "720f0e5a6102f6add19b8b05b5c09647", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10501, "upload_time": "2015-05-26T20:47:31", "url": "https://files.pythonhosted.org/packages/d6/a8/f32ef4ef4a8cae4b9f880bbcb9c1cce85fa9b63db4f8b1e1d9d57ee99ef9/amigocloud-1.0.9.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "2b06e7893f8b1dca44663d2e61c538be", "sha256": "4819f997e0c4856e4a74d686b4a440abf58bba5e486a3edb03bde44547eaf3a7" }, "downloads": -1, "filename": "amigocloud-1.1.tar.gz", "has_sig": false, "md5_digest": "2b06e7893f8b1dca44663d2e61c538be", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10839, "upload_time": "2015-08-21T20:47:58", "url": "https://files.pythonhosted.org/packages/95/54/cc50f738ba503562b29af477a3b2e8c38935714979d914b227ee62df6ec9/amigocloud-1.1.tar.gz" } ], "1.2": [ { "comment_text": "", "digests": { "md5": "a1215f0140ecc5cab0013622e0e42da2", "sha256": "277d60d43b3e6d301113cc87fc0af58de65f40d8acc7956676e78c574b01b65d" }, "downloads": -1, "filename": "amigocloud-1.2-py3-none-any.whl", "has_sig": true, "md5_digest": "a1215f0140ecc5cab0013622e0e42da2", "packagetype": "bdist_wheel", "python_version": "3.5", "requires_python": null, "size": 9501, "upload_time": "2016-10-11T01:38:49", "url": "https://files.pythonhosted.org/packages/bd/a3/7df649be03d703287eee3af342bed8deff1d3c65b36b115d917740909373/amigocloud-1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "8e07d96751a88db9aefe4e1658c278b4", "sha256": "55c0d2fb19589f45d3b5f76ffc003fc554a5dee61a15106d2f009f630a7cf594" }, "downloads": -1, "filename": "amigocloud-1.2.tar.gz", "has_sig": true, "md5_digest": "8e07d96751a88db9aefe4e1658c278b4", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13340, "upload_time": "2016-10-11T01:38:22", "url": "https://files.pythonhosted.org/packages/42/11/1c4b90ad108ccb6a331257382f40512ffe2210d60527a91622e8dc69a676/amigocloud-1.2.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "dceaf3ac5084a2f17a3876babb1af83a", "sha256": "c4a03a275e58fe87d7e019d8b7c65e9bdfc4778857cfaf2188bbfcd908a09423" }, "downloads": -1, "filename": "amigocloud-1.2.1.linux-x86_64.tar.gz", "has_sig": false, "md5_digest": "dceaf3ac5084a2f17a3876babb1af83a", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10023, "upload_time": "2017-01-19T20:22:55", "url": "https://files.pythonhosted.org/packages/f8/8b/2e6108a142fc6a4069634805aae8fcd1a4c6f737b76e6f2751b6d838863e/amigocloud-1.2.1.linux-x86_64.tar.gz" }, { "comment_text": "", "digests": { "md5": "0d803f15273280415a3c4974b7dec132", "sha256": "e5cf4f6a2163e624073c42a76747bd82228f5b6224c246ec4e3cf509d0d9d9be" }, "downloads": -1, "filename": "amigocloud-1.2.1-py2-none-any.whl", "has_sig": false, "md5_digest": "0d803f15273280415a3c4974b7dec132", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9530, "upload_time": "2017-01-19T20:31:05", "url": "https://files.pythonhosted.org/packages/c4/08/af11a1345689e663d542231a8cea2c4106ffee2238c35e86c383f1368b36/amigocloud-1.2.1-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "152565853cd75608d8a70395d2cf41cf", "sha256": "84c84b3ab2f2988727ec95728fc06ce39396c62074d159d0de7b6a9edc8c9b31" }, "downloads": -1, "filename": "amigocloud-1.2.1-py3-none-any.whl", "has_sig": false, "md5_digest": "152565853cd75608d8a70395d2cf41cf", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9531, "upload_time": "2017-01-19T20:30:03", "url": "https://files.pythonhosted.org/packages/5d/60/e9d218952bae4e8f4ac978f49d625b3f80de61a62d207a9a4e70dccf2117/amigocloud-1.2.1-py3-none-any.whl" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "0339da352e934eb1f7fa0091b916acc1", "sha256": "8b9c8ab23eb445c0b28a4fca844a173fcb5042bd5f007e68ea646e3608d5ab0a" }, "downloads": -1, "filename": "amigocloud-1.2.2.tar.gz", "has_sig": false, "md5_digest": "0339da352e934eb1f7fa0091b916acc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10532, "upload_time": "2019-10-01T17:53:22", "url": "https://files.pythonhosted.org/packages/d6/e3/d2eef0893c164b9dbd48a56a875c2ceec7a736ee1cb7dd99c091b3a9f90d/amigocloud-1.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "0339da352e934eb1f7fa0091b916acc1", "sha256": "8b9c8ab23eb445c0b28a4fca844a173fcb5042bd5f007e68ea646e3608d5ab0a" }, "downloads": -1, "filename": "amigocloud-1.2.2.tar.gz", "has_sig": false, "md5_digest": "0339da352e934eb1f7fa0091b916acc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10532, "upload_time": "2019-10-01T17:53:22", "url": "https://files.pythonhosted.org/packages/d6/e3/d2eef0893c164b9dbd48a56a875c2ceec7a736ee1cb7dd99c091b3a9f90d/amigocloud-1.2.2.tar.gz" } ] }