Skip to main content

Easily convert your Python functions into multi-command CLI program.

Project description

Clime is a Python module to let you convert a Python program contains functions into a multi-command CLI program.

Clime is very easy to use and low couple (even not!) with your source. It is a better choice than the heavy optparse or argparse for simple CLI tasks.

Let me show an example for you.

See the full documentaion on .

CLI-ize ME!

A simple script here:

def repeat(string, n=2):
    for i in range(n):
        print string

After add two lines,

import clime

… you have a CLI program now!

$ python twice

$ python -n3 thrice

And it also support --help:

usage: [-n VAL] STRING
   or: repeat [-n VAL] STRING

If you wrote the docstring, it will also show on help.

You can find more examples in the clime/examples.

See clime.Command.parse for more details about argument parsing.


Clime is hosted on two different platform, PyPI and GitHub.

  1. Install from PyPI

    Install Clime from PyPI for a stable version

    $ sudo pip install clime

    If you don’t have pip, execute

    $ sudo apt-get install python-pip

    to install pip on Debian-base Linux distribution.

  2. Get Clime from GitHub

    If you want to follow the lastest version of Clime, use

    $ git clone git://

    to clone a Clime repository. Or download manually from GitHub.


Here is the basic usage of Clime.

You have two different ways to use Clime.

  1. Insert Lines into Source

    Just add two lines below into your source

    import clime

    Recommend to put the codes into the if __name__ == '__main__': block.

  2. Use as A Command is also an executable script. Use it to convert a moudle or a Python file temporarily.

    For convenience, make a command for

    $ sudo ln -s /usr/local/lib/python<VERSION>/dist-packages/ /usr/local/bin/clime
    $ sudo chmod 755 /usr/local/bin/clime

    Then, you can use clime as a normal command


    See clime.main for more usages.

More Details

It is the all of basic of Clime. If you want to know more, please visit Take a Deeper Look at Clime.

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 clime, version 0.1.3
Filename, size File type Python version Upload date Hashes
Filename, size clime-0.1.3.tar.gz (12.9 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page