Python-digitalocean usage

From wikinotes

TODO:

Look into this more thoroughly

My initial impression of the library is that queries are performed on Manager
which returns objects representing other types (ex: Droplet).


You can also use the types directly for resource creation.

# show droplets
import digitalocean
manager = digitalocean.Manager(token='...')
droplets = manager.get_all_droplets()
print(droplets[0].networks)
for droplet in droplets:
  print(droplet.name)      # 'droplet_name'
  print(droplet.networks)  # {'v4': [{'ip_address': '1.1.1.1', 'netmask': '255.255.255.0', 'gateway': '2.2.2.2', 'type': 'public'}], 'v6': []}