python-digitalocean is a python package that provide easy access to APIs to manage droplets, images and more.

<div align="center">

<iframe src="" allowtransparency="true" frameborder="0" scrolling="0" width="220" height="30"></iframe>

<iframe src="" allowtransparency="true" frameborder="0" scrolling="0" width="150" height="30"></iframe>


How to install

You can install python-digitalocean using pip

pip install -U python-digitalocean

or via sources:

python install


python-digitalocean support all the features provided via APIs, such as:

  • Get user's Droplets
  • Get user's Images (Snapshot and Backups)
  • Get public Images
  • Get Droplet's event status
  • Create and Remove a Droplet
  • Resize a Droplet
  • Shutdown, restart and boot a Droplet
  • Power off, power on and "power cycle" a Droplet
  • Perform Snapshot
  • Enable/Disable automatic Backups
  • Restore root password of a Droplet


Shutdown all droplets

This example shows how to shutdown all the active droplets:

import digitalocean
manager = digitalocean.Manager(token="secretspecialuniquesnowflake")
my_droplets = manager.get_all_droplets()
for droplet in my_droplets:

Creating a Droplet and checking its status

This example shows how to create a droplet and how to check its status

import digitalocean
droplet = digitalocean.Droplet(token="secretspecialuniquesnowflake",
                               region='nyc2', # New York 2
                               image='ubuntu-14-04-x64', # Ubuntu 14.04 x64
                               size='512mb',  # 512MB

Checking the status of the droplet

actions = droplet.get_actions()
for action in actions:
    # Once it shows complete, droplet is up and running
    print action.status

<script> (function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){ (i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o), m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m) })(window,document,'script','//','ga');

ga('create', 'UA-10395528-24', ''); ga('send', 'pageview');