Skip to main content

A Python client for the Digital Ocean API

Project description

DOP is a MIT licensed Python wrapper for Digital Ocean’s API.

Features

Full support for all methods listed here

Installation

To install dop, simply:

$ pip install dop

Example

It is pretty easy to use:

from dop.client import Client

client = Client('client_id', 'api_key')

# Print regions.
regions = client.regions()
for region in regions:
    print(region.to_json())

# Print sizes.
sizes = client.sizes()
for size in sizes:
    print(size.to_json())

# Print public global images.
images = client.images()
for image in images:
    print(image.to_json())

# Print your private images.
images = client.images(filter='my_images')
for image in images:
    print(image.to_json())

# Create a droplet
conf = {
    'name': 'test',
    'size': {'size_slug': '512MB'},
    'image': {'image_slug': 'ubuntu-13-04-x64'},
    'region': {'region_slug': 'nyc1'},
}
droplet = client.create_droplet(**conf)

To create a droplet, you can use the data fetched from regions, sizes and images methods to fill the dictionary properly.

Contribute

Pull requests and improvements are welcome.

Version 1.6.b5
Version 1.6.b4
  • Fixed droplet creation bug

  • Improved docs

Version 1.6.b3
  • Fixed http methods for droplets

  • Change edit_domain_record method name

  • Ability to install with easy_install without error (thanks to Adam PAPAI)

Version 1.6.b1
  • Updated code to support full api

  • Improved comments for methods

  • Some refactor

Version 0.1.6
Version 0.1.5
  • Updated API

Version 0.1.4
  • Added virtio parameter to create_droplet method

  • Minor fixes in all_ssh_keys method

  • Readme region example now uses to_json() method

Version 0.1.3
Version 0.1.2
Version 0.1.1
Version 0.1.0
  • Initial release

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

dop-1.6.b5.tar.gz (9.5 kB view details)

Uploaded Source

File details

Details for the file dop-1.6.b5.tar.gz.

File metadata

  • Download URL: dop-1.6.b5.tar.gz
  • Upload date:
  • Size: 9.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for dop-1.6.b5.tar.gz
Algorithm Hash digest
SHA256 cfdffd94de0b032c5e43b360f3ed7b0715542faf96936178224543d62c34fd12
MD5 dad8f4e5648e37760c90ea0298f32991
BLAKE2b-256 86e50989c01c9c0e7196aab67bd436d100c8cdd7de5a16e4d388a7fbdddb04e3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page