by epsy

epsy / clize

CLIze: Turn Python functions into command-line interfaces

433 Stars 24 Forks Last release: Not found Other 403 Commits 18 Releases

Available items

No Items, yet!

The developer of this repository has not created any items for sale yet. Need a bug fixed? Help with integration? A different license? Create a request here:


.. image:: :target: :alt: Documentation Status .. image:: :target: :alt: Documentation Status .. image:: :alt: Join the chat at :target: .. image:: :target: .. image:: :target:

Clize is an argument parser for

_. You can use Clize as an alternative to
if you want an even easier way to create command-line interfaces.

With Clize, you can:

  • Create command-line interfaces by creating functions and passing them to
  • Enjoy a CLI automatically created from your functions' parameters.
  • Bring your users familiar
    messages generated from your docstrings.
  • Reuse functionality across multiple commands using decorators.
  • Extend Clize with new parameter behavior.

Here's an example:

.. code-block:: python

from clize import run

def hello_world(name=None, *, no_capitalize=False): """Greets the world or the given name.

:param name: If specified, only greet this person.
:param no_capitalize: Don't capitalize the given name.
if name:
    if not no_capitalize:
        name = name.title()
    return 'Hello {0}!'.format(name)
return 'Hello world!'

if name == 'main': run(hello_world)

Python 2.7 is supported through


The python code above can now be used on the command-line as follows:

.. code-block:: console

$ pip install clize
$ python3 --help
    Usage: [OPTIONS] name

Greets the world or the given name.

Positional arguments:
  name   If specified, only greet this person.

  --no-capitalize   Don't capitalize the given name.

Other actions:
  -h, --help   Show the help

$ python3 Hello world! $ python3 john Hello John! $ python3 dave --no-capitalize Hello dave!

You can find the documentation and tutorials at

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.