{ "info": { "author": "Samapriya Roy", "author_email": "samapriya.roy@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "Intended Audience :: Science/Research", "License :: OSI Approved :: Apache Software License", "Natural Language :: English", "Operating System :: OS Independent", "Programming Language :: Python", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3.6", "Programming Language :: Python :: 3.7", "Topic :: Scientific/Engineering :: GIS" ], "description": "# pydrop: Minimal Python Client for Digital Ocean Droplets\r\n\r\n[![PyPI version](https://badge.fury.io/py/pydrop.svg)](https://badge.fury.io/py/pydrop)\r\n[![DOI](https://zenodo.org/badge/DOI/10.5281/zenodo.1323340.svg)](https://doi.org/10.5281/zenodo.1323340)\r\n[![Say Thanks!](https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg)](https://saythanks.io/to/samapriya)\r\n\r\nThis is a minimal tool designed to interact with the Digital Ocean API. This does not translate all functionalities of the API but is a template I created for some of the most common operations I could perform. New tools will be added in the future as I familiarize myself further with the API structure and use as a student. For now this tool allows you to summarize all your droplets running, including and necessarily a price summary to keep tabs on your droplets monthly and hourly rates. The tool also allows you to seach by tags, delete a drop or perfrom actions such as start, stop or shutdown a droplet.\r\n\r\n## Table of contents\r\n* [Installation](#installation)\r\n* [Getting started](#getting-started)\r\n* [Digital Ocean Python CLI Tools](#digital-ocean-python-cli-tools)\r\n\t* [Digital Ocean Key](#digital-ocean-key)\r\n * [Account Info](#account-info)\r\n * [Droplets Info](#droplets-info)\r\n * [Volume Info](#volume-info)\r\n * [Snapshot Info](#snapshot-info)\r\n * [ssh read](#ssh-read)\r\n * [ssh post](#ssh-post)\r\n * [ssh delete](#ssh-delete)\r\n * [Droplets Delete](#droplets-delete)\r\n * [Droplets Reset](#droplets-reset)\r\n * [Droplets Action](#droplets-action)\r\n\r\n\r\n## Installation\r\nThis assumes that you have native python & pip installed in your system, you can test this by going to the terminal (or windows command prompt) and trying\r\n\r\n```python``` and then ```pip list```\r\n\r\nIf you get no errors and you have python 2.7.14 or higher you should be good to go. Please note that I have tested this only on python 2.7.15 but can be easily modified for python 3.\r\n\r\nTo install **Python CLI for Digital Ocean** you can install using two methods\r\n\r\n```pip install pydrop```\r\n\r\nor you can also try\r\n\r\n```\r\ngit clone https://github.com/samapriya/pydrop.git\r\ncd pydrop\r\npython setup.py install\r\n```\r\nFor linux use sudo.\r\n\r\nInstallation is an optional step; the application can be also run directly by executing pydrop.py script. The advantage of having it installed is being able to execute ppipe as any command line tool. I recommend installation within virtual environment. If you don't want to install, browse into the pydrop folder and try ```python pydrop.py``` to get to the same result.\r\n\r\n![pydrop](https://user-images.githubusercontent.com/25802584/59007392-33a91600-87f4-11e9-867c-22131bb98d32.gif)\r\n\r\n## Getting started\r\n\r\nAs usual, to print help:\r\n\r\n```\r\nusage: pydrop [-h]\r\n {dokey,accinfo,dropinfo,volinfo,snapinfo,sshread,sshpost,sshdelete,dropaction,dropdelete,dropreset}\r\n ...\r\n\r\nDigital Ocean API Python CLI\r\n\r\npositional arguments:\r\n {dokey,accinfo,dropinfo,volinfo,snapinfo,sshread,sshpost,sshdelete,dropaction,dropdelete,dropreset}\r\n dokey Enter your Digital Ocean API Key\r\n accinfo Prints your account info\r\n dropinfo Prints information about all your droplets\r\n volinfo Prints information about all your volumes\r\n snapinfo Prints information about all your snapshots\r\n sshread Prints information about your ssh keys\r\n sshpost Adds new ssh keys to account\r\n sshdelete Deletes a ssh keys from account\r\n dropaction Performs an action on your droplets\r\n dropdelete Permanently deletes the droplet\r\n dropreset Resets password for the droplet\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n\r\n```\r\n\r\nTo obtain help for a specific functionality, simply call it with _help_ switch, e.g.: `pydrop dropinfo -h`. If you didn't install pydrop, then you can run it just by going to *pydrop* directory and running `python pydrop.py [arguments go here]`\r\n\r\n## Digital Ocean Python CLI Tools\r\nThe Digital Ocean Python CLI and tools setup contains minimal CLI in python to perform basic actions on droplets along with query and analyze your DO enviroment quickly.\r\n\r\n### Digital Ocean Key\r\nThis tool basically asks you to input your Digital Ocean API Key using a password prompt this is then used for all subsequent tools. This tool now includes an option for a quiet authentication using the API key incase it is unable to invoke an interactive environment such as in Google colaboratory.\r\n\r\n```\r\nusage: pydrop dokey [-h] [--key KEY]\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n\r\nOptional named arguments:\r\n --key KEY Your Digital Ocean API Key\r\n```\r\n\r\nIf using on a private machine the Key is saved as a csv file for all future runs of the tool.\r\n\r\n### Droplets Info\r\nThis tool prints account info about your account including, droplet and volume limit, your email, and so on. The setup would be\r\n\r\n```\r\npydrop accinfo\r\n```\r\n\r\n### Droplets Info\r\nThe droplets info tool prints summary info about all your droplets. You can choose to narrow it down further using a droplet tag so only those droplets with speific tags will be printed. Since I wanted the ability of including price summaries, I have included prices summaries.\r\n\r\n```\r\nusage: pydrop dropinfo [-h] [--tag TAG]\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n\r\nOptional named arguments:\r\n --tag TAG Use a tag to refine your search\r\n```\r\n\r\n### Volume Info\r\nAs the name suggest incase you have any volumes attched, this will print information about the volumes attached. If no volumes exists, it will print that and exit out. The setup would be\r\n\r\n```\r\npydrop volinfo\r\n```\r\n\r\n### Snapshot Info\r\nThis will print information about any existing snapshot that you might have. Setup again is\r\n\r\n```\r\npydrop snapinfo\r\n```\r\n\r\n### ssh read\r\nThis setup will simply read all your ssh keys and print them including the key, the id , name and so on. Setup would be\r\n\r\n```\r\npydrop sshread\r\n```\r\n\r\n### ssh post\r\nThis will allow you to add a new ssh key to your existing ssh keys. The required inputs are name and the key\r\n\r\n```\r\nusage: pydrop sshpost [-h] --name NAME --keyfile KEYFILE\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n\r\nRequired named arguments.:\r\n --name NAME name for ssh key\r\n --keyfile KEYFILE file with ssh key\r\n```\r\n\r\n### ssh delete\r\nThis will delete an ssh key, if no key id is provided, the tool first prints out all the ssh keys and their ids to choose from. Setup with a keyid would be simply\r\n\r\n```\r\npydrop sshdelete\r\n```\r\n\r\nThe above command will essentially call a sshread function to get you the key ids. If you know the key id the command then takes that as an input\r\n\r\n```\r\nusage: pydrop sshdelete [-h] [--keyid KEYID]\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n\r\nOptional named arguments:\r\n --keyid KEYID ssh key id\r\n```\r\n\r\n### Droplets Delete\r\nThis deletes a droplet and you can specify either the droplet name or id. Incase you don't remember the name or id, just run the tool without any arguments and it will list out all droplet id(s) and names.\r\n```\r\nusage: pydrop dropdelete [-h] [--id ID] [--name NAME]\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n\r\nOptional named arguments:\r\n --id ID Use an image ID to delete droplet\r\n --name NAME Use an image name to delete droplet\r\n```\r\n\r\n### Droplets Reset\r\nThis resets the password of a droplet and you can specify either the droplet name or id. Incase you don't remember the name or id, just run the tool without any arguments and it will list out all droplet id(s) and names.\r\n```\r\nusage: pydrop dropreset [-h] [--id ID] [--name NAME]\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n\r\nOptional named arguments:\r\n --id ID Use an image ID to delete droplet\r\n --name NAME Use an image name to delete droplet\r\n```\r\n\r\n### Droplets Action\r\nThe droplet action tool was designed to achieve and have more control over individual droplet actions and I included actions such as shutdown, power off, power on and rename. Just like the droplet delete tool, this tool will print the name and id of all droplets if no arguments are passed and you can then choose the one on which to perform the action.\r\n\r\n```\r\nusage: pydrop dropaction [-h] [--id ID] [--name NAME] [--action ACTION]\r\n [--rename RENAME]\r\n\r\noptional arguments:\r\n -h, --help show this help message and exit\r\n\r\nOptional named arguments:\r\n --id ID Use an image ID to perform action\r\n --name NAME Use an image name to perform action\r\n --action ACTION Action type |shutdown=\"graceful shutdown\"|power_off=\"hard\r\n shutdown\"|power_on=\"power on\"|rename=\"rename\r\n --rename RENAME Incase you are renaming droplet you can provide new name\r\n```\r\n\r\n### Changelog\r\n\r\n**v0.0.5**\r\n* Added additional tools like sshfunctions, volume and snapshot reads\r\n* General improvements to overall tool\r\n\r\n**v0.0.4**\r\n* Now calculates total cost till date based on active droplets\r\n\r\n**v0.0.3**\r\n* Now checks for keys and auto initializes if missing\r\n* Includes password reset tool\r\n\r\n\r\n\r\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/samapriya/pydrop", "keywords": "", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "pydrop", "package_url": "https://pypi.org/project/pydrop/", "platform": "", "project_url": "https://pypi.org/project/pydrop/", "project_urls": { "Homepage": "https://github.com/samapriya/pydrop" }, "release_url": "https://pypi.org/project/pydrop/0.0.5/", "requires_dist": [ "requests (>=2.19.1)", "arrow (>=0.12.1)" ], "requires_python": "", "summary": "Python Client for Digital Ocean Droplets", "version": "0.0.5" }, "last_serial": 5377080, "releases": { "0.0.1": [ { "comment_text": "", "digests": { "md5": "bfafeab9cdf9e954a3b74cc641697ea5", "sha256": "374acd70d77e57485cc2e4440610d410f979416630dc565b62ed12991cf33275" }, "downloads": -1, "filename": "pydrop-0.0.1.tar.gz", "has_sig": false, "md5_digest": "bfafeab9cdf9e954a3b74cc641697ea5", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6836, "upload_time": "2018-07-23T14:22:45", "url": "https://files.pythonhosted.org/packages/00/89/4f8adfd75b0253cb7949d2be23bcd9476f049db38aadabf45a2b5beaed60/pydrop-0.0.1.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "b91a3ca650876479ca1907d62d9c2b34", "sha256": "5c28ba3f736b3c9e71a5c8e044f8474edcd1e776192c2730b3b4f9514fd680d3" }, "downloads": -1, "filename": "pydrop-0.0.2.tar.gz", "has_sig": false, "md5_digest": "b91a3ca650876479ca1907d62d9c2b34", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6445, "upload_time": "2018-07-23T21:41:30", "url": "https://files.pythonhosted.org/packages/82/cf/306f62012d284bec35179ea97da14d204ac84d05ebd1fd8da079b11a565c/pydrop-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "5b35126b51e6c813fcbb0260b3fecb53", "sha256": "66896689d1ff6bebc0c20c0c1f43a0c169817a4d7eac3cf5b20b5db4a7752e22" }, "downloads": -1, "filename": "pydrop-0.0.3.tar.gz", "has_sig": false, "md5_digest": "5b35126b51e6c813fcbb0260b3fecb53", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8823, "upload_time": "2018-07-29T21:09:16", "url": "https://files.pythonhosted.org/packages/ef/85/2504ba8757558d87c0d6ac4bc51efdb5dc3f917ac1cf3565312befb6effe/pydrop-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "d1fb9666140c0e06c47c71ab88e2378d", "sha256": "17777c210efebfdf801b238cfd308702265670031c6cc477ae7df5f13c440ad7" }, "downloads": -1, "filename": "pydrop-0.0.4.tar.gz", "has_sig": false, "md5_digest": "d1fb9666140c0e06c47c71ab88e2378d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9027, "upload_time": "2018-08-08T15:43:40", "url": "https://files.pythonhosted.org/packages/1c/10/edee6a3cb9c1743c3fc861966679d8e070c8b56665a89ecfe6b9bacd0729/pydrop-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "1b9367ac78220d6c82652967cfdc3576", "sha256": "07367947fabdf0a10a5fd5a5233583aaf348321e5a4aa5e52ec6fdc79790e794" }, "downloads": -1, "filename": "pydrop-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1b9367ac78220d6c82652967cfdc3576", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8690, "upload_time": "2019-06-09T07:45:44", "url": "https://files.pythonhosted.org/packages/5d/82/c310916ead14223662ac3a44633a82dd76386eefa6a0a7fa19d5a23b26e3/pydrop-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6c287d853c082a3dfe271f5120241f1", "sha256": "ed29d0afec7cf6b66ce9810ccb1b85a774615d438e02dc55a37493b3cb03cbd6" }, "downloads": -1, "filename": "pydrop-0.0.5.tar.gz", "has_sig": false, "md5_digest": "d6c287d853c082a3dfe271f5120241f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11805, "upload_time": "2019-06-09T07:45:46", "url": "https://files.pythonhosted.org/packages/f8/b0/d2480e515ddbc634181e4f2f02fab9e8e090e90582b9b6cfd51e1311fd8b/pydrop-0.0.5.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1b9367ac78220d6c82652967cfdc3576", "sha256": "07367947fabdf0a10a5fd5a5233583aaf348321e5a4aa5e52ec6fdc79790e794" }, "downloads": -1, "filename": "pydrop-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1b9367ac78220d6c82652967cfdc3576", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8690, "upload_time": "2019-06-09T07:45:44", "url": "https://files.pythonhosted.org/packages/5d/82/c310916ead14223662ac3a44633a82dd76386eefa6a0a7fa19d5a23b26e3/pydrop-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d6c287d853c082a3dfe271f5120241f1", "sha256": "ed29d0afec7cf6b66ce9810ccb1b85a774615d438e02dc55a37493b3cb03cbd6" }, "downloads": -1, "filename": "pydrop-0.0.5.tar.gz", "has_sig": false, "md5_digest": "d6c287d853c082a3dfe271f5120241f1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11805, "upload_time": "2019-06-09T07:45:46", "url": "https://files.pythonhosted.org/packages/f8/b0/d2480e515ddbc634181e4f2f02fab9e8e090e90582b9b6cfd51e1311fd8b/pydrop-0.0.5.tar.gz" } ] }