Skip to main content

A set of useful APIs for cloudmesh

Project description

Cloudmesh Common

Note: The page is outomatically generated, do not edit it. To modify change the content in Curley brackets must use two in

image Python License Format Status Travis

Installation and Documentation

Please note that several packages are available which are pointed to in the installation documentation.

Installation Instructions

Highlighted features

This library contains a number of useful functions and APIs that we highlight here. They are used to interact with the system and provide a number of functions to implement command line programs and shells.


The console provides convenient way to print colored messages types in the terminal, such as errors, info, and regular messages

from cloudmesh.common.console import Console

Console.error("this is an error printed in red wth prefix ERROR:")
Console.msg("this is a msg printed in black")
Console.ok("this is an ok message printed in green")


We have lots of shell commands that call linux commands, but also have a convenient execution command that returns the results in a string.

For more information we like you to inspect the source code:

from cloudmesh.common.Shell import Shell

shell = Shell()


# prints after the command is finished
r = shell.execute('pwd') 

# prints while the command is executed
r ='pwd') 

# open a new terminal and start the command ls in it (for OSX and Gnome)

# an example of a build in command
shell.pip("install cloudmesh-common")

We have many such build in commands, please see the source


A convenient way to print dictionaries and lists with repeated entries as tables, csv, json, yaml. The dictionaries can even be hierarchical.

Let us assume we have

data = [
        "name": "Gregor",
        "address": {
            "street": "Funny Lane 11",
            "city": "Cloudville"
        "name": "Albert",
        "address": {
            "street": "Memory Lane 1901",
            "city": "Cloudnine"

Then we can print it nicely with

                    order=["name", "address.street", ""],
                    header=["Name", "Street", "City"],

Other formats such as csv, json, dict are also supported.

In addition we have also printers for printing attribute lists. Please consult the source code.


A convenient way on using named timers

from cloudmesh.common.StopWatch import StopWatch
import os

watch = StopWatch()


print (watch["test"])

To print them, you can aslo use



One dimensional Dictionaries in dot format.

from cloudmesh.common.dotdict import doctict

# convert a simple dict to a dotdict
d = dotdict({"name": "Gregor"})
# Now you can say



Very useful functions are included in util

Especially useful are

  • generating passwords
  • banners
  • yn_choices
  • path_expansion
  • grep (simple line matching)
  • HEADING() which without parameter identifies the name of the function and prints its name within a banner


  • added support for terminals with dark background

Download files

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

Files for cloudmesh-common, version 4.3.12
Filename, size File type Python version Upload date Hashes
Filename, size cloudmesh_common-4.3.12-py2.py3-none-any.whl (76.3 kB) File type Wheel Python version py2.py3 Upload date Hashes View
Filename, size cloudmesh-common-4.3.12.tar.gz (63.4 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