skip to navigation
skip to content

Not Logged In

poseidon 0.3.0

Python library for managing Digital Ocean account

Latest Version: 0.3.1

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')
 
File Type Py Version Uploaded on Size
poseidon-0.3.0.tar.gz (md5) Source 2014-08-09 8KB
  • Downloads (All Versions):
  • 0 downloads in the last day
  • 36 downloads in the last week
  • 235 downloads in the last month