Exploit DigitalOcean API through the console.
Create DigitalOcean droplets like a breeze through the command line.
You may read the full documentation on ReadTheDocs.
Before installing this package make sure you have an account to Digital Ocean and have obtained a Digital Ocean API token The recommended way of storing the token is via environment variable. Once you copy it, do the following:
$ vim ~/.profile or nano ~/.profile # make sure the following line is added $ export DO_TOKEN="API TOKEN HERE" # or other name than DO_TOKEN $ source ~/.profile
Installation is just a pip install away:
(virtualenv_name) $ pip install beauty-ocean
You are using virtualenv, don’t you? If not, install it inside your ~/.local directory.
$ pip install --user beauty-ocean
For the moment, this package implements the creation of Digital Ocean droplets but very soon it will support the creation of Domains and Networks. Once installed, the droplet command will be available at your disposal. It accepts a single option --token or -t for short. Defaults to "DO_TOKEN" which is the name of the environment variable that you created earlier. If you used a different name then pass that name to the -t option.
$ droplet # or $ droplet -t MY_ENV_NAME_FOR_TOKEN
You may, also, pass a file path to the -t option where this file holds the token only.
$ droplet --t path/to/file/that/holds/the/token
Lastly, but not recommended, you may pass directly, to the -t option, the token itself.
$ droplet --t THE_ACTUAL_API_TOKEN_HERE
Once the token is resolved, a series of questions will be initiated in order to get the available data from you, submit this data to the Digital Ocean API and create the droplet. All the above come in a good-looking format of questions.
Finally, a json string will be returned with all the droplet data at your disposal to use it in any way you want.
Beautiful command-line-interface questions flow with sensible defaults
Supports remote or local SSH keys addition and/or remote/local Tags
An mp4 video demo can be found here.
This package was created using:
audreyr/cookiecutter-pypackage project template
python-digitalocean python library for DigitalOcean API
colored to color the prompt
yaspin to display a “loading” animation while fetching data
click to create the command line
sshpubkeys to parse/validate public key(s)
I do not work at DigitalOcean, neither have any benefits (financial or professional) from creating this package. This package was created because it facilitates my workflow during droplet creation and website deployment and I wanted to share it with other developers. Sharing is a good thing!
First release on PyPI.
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Hashes for beauty_ocean-0.1.2-py3-none-any.whl