This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

[![Build Status](](

A pythonic remote control of servers via ssh


Install the library

virtualenv venv && . venv/bin/activate # optional
pip install sh

You need to configure passwordless SSH for your remote hosts:

ssh-keygen -q -t rsa -N 'your_password_here' -f ~/.ssh/id_rsa
ssh-copy-id localhost # Repeat this for each host
eval `ssh-agent`
ssh localhost pwd # test connection

Next, create an SSH config file in `~/.ssh/config` describing your hosts:

Host localhost
User user
HostName localhost
IdentityFile ~/.ssh/id_rsa.key

Host osx
User user
HostName steve-mac
IdentityFile ~/.ssh/id_rsa.key

Host projects
User user
IdentityFile ~/.ssh/projects.key

Host prod
User produser
IdentityFile ~/.ssh/deploy.key


Now you can run remote commands using simple python code

from budgie import localhost
print localhost.hostname(), localhost.uptime()

You can also callhosts ing this alternate method if the magic above is to much

import budgie
print budgie.ssh('localhost'), budgie.ssh('localhost').uptime()

Passing in SSH Options
budgie will allow the passing in of SSH options. At this time this is done through the bake method in the same way you would pass this into the sh.ssh()

budgie.localhost.bake('-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no').whoami()


budgie.ssh().bake('-o', 'UserKnownHostsFile=/dev/null', '-o', 'StrictHostKeyChecking=no', '').whoami()

This does need to be cleaned up to make more logical sense.

Using Sudo
Just as in sh sudo is just treated as another budgie command.

So executing a remote command is as simple as:'/etc/hosts')

You will need to ensure that sudo is either allowing the remote user you connect with to exec the command via /etc/sudoers

Budgie Host Groups
budgie offers the ability to bundle ssh hosts for batch command execution. This is done through creating a host group. A host group will take in a list of host names or budgie.ssh instances.

web_servers = budgie.HostGroup()

webservers.add(['', ''])

www1 = budgie.ssh('')
www2 = budgie.ssh('')
webservers.add([www1, www2])


web_servers.HostGroup(['', ''])

www1 = budgie.ssh('')
www2 = budgie.ssh('')
web_servers.HostGroup([www1, www2])

Once a budgie.HostGroup() is created it can be intereacted with like a standard dictionary.

Commands can be executed against the host group and results of execution will be supplied back as a dictionary

result = web_servers.whoami()

Result would contain

{'www1': '', 'www2': ''}

Running Tests

`` can be called via the commandlime and is run on each commit through Travis CIq

Tests can be called by running


This is the current test suite being applied to builds
*Import Test
*Direct Call Goes to Exception Test
*Command Execution (whoami) Test
*HostGroup Creation
*HostGroup Manipulation (add, remove)
*HostGroup Command Execution (whoami) Test

Command execution test uses SSH options that allow for the automatic generation of SSH keypairs and discarding them from known hosts at the conclusion of the connection.

Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
budgie-0.1.tar.gz (5.1 kB) Copy SHA256 Checksum SHA256 Source Sep 7, 2014

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting