Skip to main content

Python library for managing Digital Ocean account

Project description

A library of tools for managing your DigitalOcean account built on top of a Python wrapper for the DigitalOcean API v2

DigitalOcean is known for being developer friendly, I wanted to make it even more so. Here’s a short example to do a test deployment of a Flask app from your github repo (see github for details on how to setup with the right environment variables, DIGITALOCEAN_API_KEY and GITHUB_TOKEN)

import poseidon as P
con = P.connect()
ssh_key_id = con.keys.list()[0]['id']
droplet = con.droplets.create(<domain>, 'sfo1', '512mb',
                              'ubuntu-14-04-x64', ssh_keys=[ssh_key_id])
records = con.domains.create(<domain>, droplet.ip_address)
records.create('A', data=droplet.ip_address)
ssh = droplet.connect()
ssh.apt('git python-pip')
ssh.git(username=<username>, repo=<repo_name>)
ssh.chdir(<repo_name>)
ssh.pip_r('requirements.txt')
ssh.nohup('python app.py')

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

poseidon-0.3.0.tar.gz (8.5 kB view hashes)

Uploaded Source

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