Coder Social home page Coder Social logo

dop's Introduction

DOP: Digital Ocean API Python Wrapper

https://badge.fury.io/py/dop.png https://pypip.in/d/dop/badge.png

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.

How to initialise with client_id and api_key stored in creds file

Easy:

from dop.client import Client

client = Client.fromCredsFile('/home/user/.do.creds')

Contribute

Pull requests and improvements are welcome.

dop's People

Contributors

ahmontero avatar samdobson avatar covertgeek avatar 2r2w avatar alex-sf avatar volkhin avatar wummel avatar bitdeli-chef avatar cleberjsantos avatar dsegonds avatar joshpurvis avatar samuelclay avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.