Skip to main content

Digital Ocean PYthon client that Sucks Less

Project description

# Digital Ocean PYthon wrapper that Sucks Less

Inspired by and

## Installation

pip install dopysl

## Getting Started

Credentials for DigitalOcean API should be passed in environment variables.
There is API v1 and v2.

If you want to use APIv2, you need to find out the api token from and you shoud set it as envvar:

export DO_API_TOKEN=...

If you still want to use APIv1 you need to define client ID and API key. **!!!Beware, API key for v1 is different than API token for v2 !!!**. Find it out from and set it as:

export DO_CLIENT_ID=...
export DO_API_KEY=...

## Usage

Theres is as Proxy singleton which you can use to query DigitalOcean API. To list all the droplets:

import dopysl
print dopysl.all_active_droplets()

alternatively more prettily:

import dopysl
import json

pp = lambda chunk: json.dumps(chunk, sort_keys=True, indent=4)


If you use APIv2 you can use strings instead of id for regions, sizes, etc.
i.e. you can do

dopysl.new_droplet('new_vm', '512mb', 'lamp', 'ams2')

If you use APIv1 you first need to get ID of those.

# Methods

The methods of the DoManager are self explanatory; ex.

dopysl.new_droplet('new_droplet', 66, 1601, 1)

The methods for v.2 API are similar, the only difference
is using names instead of IDs for domains and slugs for
sizes, images and datacenters; ex.

dopysl.new_droplet('new_droplet', '512mb', 'lamp', 'ams2')

More in

Project details

Download files

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

Files for dopysl, version 0.0.2
Filename, size File type Python version Upload date Hashes
Filename, size dopysl-0.0.2.tar.gz (6.0 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page