Skip to main content

Python Library for Tutum

Project description

Python library for Tutum’s API. Full documentation available at

Installing the library

In order to install the Tutum Python library, you can use pip install:

pip install python-tutum

It will install a Python module called tutum which you can use to interface with the API.


In order to be able to make requests to the API, you should first obtain an ApiKey for your account. For this, log into Tutum, click on the menu on the upper right corner of the screen, and select Get Api Key

You can use your ApiKey with the Python library in any of the following ways (will be used in this order):

  • Manually set it in your Python initialization code:
import tutum
tutum.user = "username"
tutum.apikey = "apikey"
  • Store it in a configuration file in ~/.tutum:
user = "username"
apikey = "apikey"
  • Set the environment variables TUTUM_USER and TUTUM_APIKEY:
export TUTUM_USER=username
export TUTUM_APIKEY=apikey


Errors in the HTTP API will be returned with status codes in the 4xx and 5xx ranges.

The Python library will detect this status codes and raise TutumApiError exceptions with the error message, which should be handled by the calling application accordingly.

Quick examples


>>> import tutum
>>> tutum.Service.list()
[<tutum.api.service.Service object at 0x10701ca90>, <tutum.api.service.Service object at 0x10701ca91>]
>>> service = tutum.Service.fetch("fee900c6-97da-46b3-a21c-e2b50ed07015")
<tutum.api.service.Service object at 0x106c45c10>
>>> service = tutum.Service.create(image="tutum/hello-world", name="my-new-app", target_num_containers=2)
>>> service.target_num_containers = 3
>>> service.stop()
>>> service.start()
>>> service.delete()


>>> import tutum
>>> tutum.Container.list()
[<tutum.api.container.Container object at 0x10701ca90>, <tutum.api.container.Container object at 0x10701ca91>]
>>> container = tutum.Container.fetch("7d6696b7-fbaf-471d-8e6b-ce7052586c24")
<tutum.api.container.Container object at 0x10701ca90>
>>> container.public_dns = ""
>>> container.stop()
>>> container.start()
>>> container.logs
"2014-03-24 23:58:08,973 CRIT Supervisor running as root (no user in config file) [...]"
>>> container.delete()

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 python-tutum, version 0.21.2
Filename, size File type Python version Upload date Hashes
Filename, size python-tutum-0.21.2.tar.gz (34.8 kB) File type Source Python version None Upload date Hashes View

Supported by

Pingdom Pingdom Monitoring Google Google Object Storage and Download Analytics Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page