python-doctl
python-doctl copied to clipboard
A Python wrapper for the Digital Ocean CLI utility — doctl.
python-doctl
A Python wrapper for the excellent doctl command-line utility, from DigitalOcean.
Usage
>>> import doctl
>>> for droplet in doctl.compute.droplet.list():
... print(droplet['name'])
pypi.kennethreitz.org
code.kennethreitz.org
build.kennethreitz.org
…
>>> for key in doctl.compute.ssh_key.list():
... print(key['name'])
Blink (iPad)
thoth
macbook
All methods return Python data structures, includinging timezone–aware Datetime objects.
Notes
Use of the DIGITALOCEAN_ACCESS_TOKEN environment variable is recommended.
Available Namespaces
The entire API surface of doctl is covered by this library, so the following namespaces are available for your use and enjoyment:
compute.accountcompute.actioncompute.certificatecompute.domaincompute.domain_recordscompute.dropletcompute.firewallcompute.floating_ipcompute.imagecompute.image_actioncompute.load_balancercompute.plugincompute.region_listcompute.size_listcompute.snapshotcompute.ssh_keycompute.tagcompute.volumecompute.volume_action
Installation
$ pipenv install doctl
✨🍰✨