Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (
Help us improve Python packaging - Donate today!

A library for writing long running processes with a cli interface

Project Description

python library for writing long running processes with a cli interface

oi image


Note: You need nanomsg installed on your system:

$ git clone
$ cd nanomsg
$ ./configure
$ make
$ make check
$ sudo make install

Then install oi

$ pip install oi


1. Write your long running program


import oi

program = oi.Program('my program', 'ipc:///tmp/program.sock')
program.add_command('ping', lambda: 'pong')
program.add_command('state', lambda: program.state)  # program will run forever

2. Add a ctl interface


import oi

ctl = oi.CtlProgram('ctl program', address='ipc:///tmp/program.sock')

3. Run program, then connect to it via ctl

# Run process
$ python programd

# OR with a configuration file
$ python programd --config /etc/program.conf

$ python programctl  # enter ctl loop
programctl > ping

# OR ping end exit
$ python programctl ping

Quickly get started with a new project

$ mkdir xprogram
$ cd xprogram

$ oi init
$ make install

# Start your program
$ xprogramd

# Start ctl program
$ xprogramctl
ctl > ping

# Upload to pypi (Edit before distributing)
$ make distribute

Now the interesting bit. Are you ready?

Run your program on one computer, then control it from another with a single line change (actually two).

Just change the address ipc:///tmp/program.sock to a tcp address, such as tcp:// in both your and That’s it! (:


  • [ ] Add more testing


MIT License

Release History

This version
History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


History Node


Download Files

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

File Name & Hash SHA256 Hash Help Version File Type Upload Date
(8.8 kB) Copy SHA256 Hash SHA256
Source Mar 11, 2016

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