{ "info": { "author": "skylabtech", "author_email": "info@skylabtech.ai", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Topic :: Communications :: Email" ], "description": "# Skylab Genesis Python Client\n\n[![CircleCI](https://circleci.com/gh/skylab-tech/genesis_client_python.svg?style=svg)](https://circleci.com/gh/skylab-tech/genesis_client_python)\n[![Maintainability](https://api.codeclimate.com/v1/badges/6e3316f60d72a9ca9276/maintainability)](https://codeclimate.com/github/skylab-tech/genesis_client_python/maintainability)\n[![Test Coverage](https://api.codeclimate.com/v1/badges/6e3316f60d72a9ca9276/test_coverage)](https://codeclimate.com/github/skylab-tech/genesis_client_python/test_coverage)\n\nSkylabTech Genesis Python client.\n\n[genesis.skylabtech.ai](https://genesis.skylabtech.ai)\n\n## Requirements\n\n- [Python requests library](http://docs.python-requests.org/en/master/user/install/#install)\n\n## Installation\n\n```bash\n$ pip install skylab_genesis\n```\n\n## Usage\n\nFor all examples, assume:\n\n```python\nimport skylab_genesis\n\napi = skylab_genesis.api(api_key='YOUR-API-KEY')\n```\n\n### Error Handling\n\nBy default, the API calls return a response object no matter the type of response.\n\n### Endpoints\n\n#### List all jobs\n\n```python\napi.list_jobs()\n```\n\n#### Create job\n\n```python\npayload = {\n 'profile_id': 1\n}\n\napi.create_job(payload=payload)\n```\n\nFor all payload options, consult the [API documentation](http://docs.genesis.skylabtech.ai/#operation/createJob).\n\n#### Get job\n\n```python\napi.get_job(job_id=1)\n```\n\n#### Update job\n\n```python\npayload = {\n 'profile_id': 2\n}\n\napi.create_job(job_id=1, payload=payload)\n```\n\nFor all payload options, consult the [API documentation](http://docs.genesis.skylabtech.ai/#operation/updateJobById).\n\n#### Delete job\n\n```python\napi.delete_job(job_id=1)\n```\n\n#### Process job\n\n```python\napi.process_job(job_id=1)\n```\n\n#### Cancel job\n\n```python\napi.cancel_job(job_id=1)\n```\n\n#### List all profiles\n\n```python\napi.list_profiles()\n```\n\n#### Create profile\n\n```python\npayload = {\n 'profile_id': 1\n}\n\napi.create_profile(payload=payload)\n```\n\nFor all payload options, consult the [API documentation](http://docs.genesis.skylabtech.ai/#operation/createProfile).\n\n#### Get profile\n\n```python\napi.get_profile(profile_id=1)\n```\n\n#### Update profile\n\n```python\npayload = {\n 'profile_id': 2\n}\n\napi.create_profile(profile_id=1, payload=payload)\n```\n\nFor all payload options, consult the [API documentation](http://docs.genesis.skylabtech.ai/#operation/updateProfileById).\n\n#### Delete profile\n\n```python\napi.delete_profile(profile_id=1)\n```\n\n#### List all photos\n\n```python\napi.list_photos()\n```\n\n#### Create photo\n\n```python\npayload = {\n 'photo_id': 1\n}\n\napi.create_photo(payload=payload)\n```\n\nFor all payload options, consult the [API documentation](http://docs.genesis.skylabtech.ai/#operation/createPhoto).\n\n#### Get photo\n\n```python\napi.get_photo(photo_id=1)\n```\n\n#### Update photo\n\n```python\npayload = {\n 'photo_id': 2\n}\n\napi.create_photo(photo_id=1, payload=payload)\n```\n\nFor all payload options, consult the [API documentation](http://docs.genesis.skylabtech.ai/#operation/updatePhotoById).\n\n#### Delete photo\n\n```python\napi.delete_photo(photo_id=1)\n```\n\n### Expected Responses\n\n#### Success\n\n```bash\n >>> response.status_code\n 200\n\n >>> response.json().get('success')\n True\n\n >>> response.json().get('status')\n u'OK'\n\n >>> response.json().get('profile_id')\n u'numeric-profile-id'\n```\n\n#### Error\n\n* Malformed request\n\n```bash\n >>> response.status_code\n 400\n```\n\n* Bad API key\n\n```bash\n >>> response.status_code\n 403\n```\n\n## Testing\n\nUse [tox](https://tox.readthedocs.io/en/latest/) to run the tests:\n\n```bash\ntox\n```\n\n### Testing Multiple Python Versions\n\nThis assumes you have [tox](https://tox.readthedocs.io/en/latest/) installed and used\n[pyenv](https://github.com/yyuu/pyenv) to install multiple versions of python.\n\nOnce all the supported python versions are installed simply run:\n\n```bash\ntox\n```\n\nThis will run the tests against all the versions specified in `tox.ini`.\n\n## Troubleshooting\n\n### General Troubleshooting\n\n- Enable debug mode\n- Make sure you're using the latest Python client\n- Capture the response data and check your logs — often this will have the exact error\n\n### Enable Debug Mode\n\nDebug mode prints out the underlying request information as well as the data\npayload that gets sent to Genesis. You will most likely find this information\nin your logs. To enable it, simply put `debug=True` as a parameter when instantiating\nthe API object. Use the debug mode to compare the data payload getting\nsent to [Genesis' API docs](http://docs.genesis.skylabtech.ai/#).\n\n```python\nimport skylab_genesis\n\napi = skylab_genesis.api(api_key='YOUR-API-KEY', debug=True)\n```\n### Response Ranges\n\nGenesis' API typically sends responses back in these ranges:\n\n- 2xx \u2013 Successful Request\n- 4xx \u2013 Failed Request (Client error)\n- 5xx \u2013 Failed Request (Server error)\n\nIf you're receiving an error in the 400 response range follow these steps:\n\n- Double check the data and ID's getting passed to Genesis\n- Ensure your API key is correct\n- Log and check the body of the response\n\n## Distribution\n\nTo package:\n\n```bash\n python setup.py sdist bdist_wheel upload\n```\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/skylab-tech/genesis_client_python", "keywords": "", "license": "LICENSE.txt", "maintainer": "", "maintainer_email": "", "name": "skylab-genesis", "package_url": "https://pypi.org/project/skylab-genesis/", "platform": "", "project_url": "https://pypi.org/project/skylab-genesis/", "project_urls": { "Homepage": "https://github.com/skylab-tech/genesis_client_python" }, "release_url": "https://pypi.org/project/skylab-genesis/1.0.0/", "requires_dist": [ "requests (>=2.0.0)", "pytest (>=3.0.5) ; extra == 'test'", "pytest-cov (>=2.6.1) ; extra == 'test'", "requests-mock (>=1.5.2) ; extra == 'test'" ], "requires_python": "", "summary": "Skylab Genesis python client", "version": "1.0.0" }, "last_serial": 5000887, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "f7d825fe935cc11129cff9dcb402447e", "sha256": "80a42bf8141978a80e747b94cf011bd5ec082a8b92c52f46fc424a2b67f7fa58" }, "downloads": -1, "filename": "skylab_genesis-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "f7d825fe935cc11129cff9dcb402447e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9100, "upload_time": "2019-03-28T23:01:39", "url": "https://files.pythonhosted.org/packages/35/7a/4cc8fd53a733974ac14ac85a8b97bf5d61d64df2a0eda41b9510e4e20004/skylab_genesis-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d01958d5e9c993d72bee45b8c509a440", "sha256": "319f8e83b2bcb05f77e0c303466e95fba9d47c2c19fe1f80aa960d9b7877cc0e" }, "downloads": -1, "filename": "skylab_genesis-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d01958d5e9c993d72bee45b8c509a440", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5816, "upload_time": "2019-03-28T23:01:41", "url": "https://files.pythonhosted.org/packages/3e/32/3bf10100cea4ab72a4880d88afaf19a91604cb034e542130ffafeaca1446/skylab_genesis-1.0.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "f7d825fe935cc11129cff9dcb402447e", "sha256": "80a42bf8141978a80e747b94cf011bd5ec082a8b92c52f46fc424a2b67f7fa58" }, "downloads": -1, "filename": "skylab_genesis-1.0.0-py2-none-any.whl", "has_sig": false, "md5_digest": "f7d825fe935cc11129cff9dcb402447e", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 9100, "upload_time": "2019-03-28T23:01:39", "url": "https://files.pythonhosted.org/packages/35/7a/4cc8fd53a733974ac14ac85a8b97bf5d61d64df2a0eda41b9510e4e20004/skylab_genesis-1.0.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d01958d5e9c993d72bee45b8c509a440", "sha256": "319f8e83b2bcb05f77e0c303466e95fba9d47c2c19fe1f80aa960d9b7877cc0e" }, "downloads": -1, "filename": "skylab_genesis-1.0.0.tar.gz", "has_sig": false, "md5_digest": "d01958d5e9c993d72bee45b8c509a440", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5816, "upload_time": "2019-03-28T23:01:41", "url": "https://files.pythonhosted.org/packages/3e/32/3bf10100cea4ab72a4880d88afaf19a91604cb034e542130ffafeaca1446/skylab_genesis-1.0.0.tar.gz" } ] }