Skip to main content
Documentation Status Documentation Status Join the chat at https://gitter.im/epsy/clize https://github.com/epsy/clize/actions/workflows/tox-test.yml/badge.svg?branch=master https://coveralls.io/repos/epsy/clize/badge.svg?branch=master

Clize is an argument parser for Python. You can use Clize as an alternative to argparse 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 clize.run.

  • Enjoy a CLI automatically created from your functions’ parameters.

  • Bring your users familiar --help messages generated from your docstrings.

  • Reuse functionality across multiple commands using decorators.

  • Extend Clize with new parameter behavior.

Here’s an example:

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 decorators.

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

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

    Greets the world or the given name.

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

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

    Other actions:
      -h, --help   Show the help
$ python3 hello.py
Hello world!
$ python3 hello.py john
Hello John!
$ python3 hello.py dave --no-capitalize
Hello dave!

You can find the documentation and tutorials at https://clize.readthedocs.io/

Download files

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

Source Distribution

clize-4.2.1.tar.gz (66.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

clize-4.2.1-py2.py3-none-any.whl (71.8 kB view details)

Uploaded Python 2Python 3

File details

Details for the file clize-4.2.1.tar.gz.

File metadata

  • Download URL: clize-4.2.1.tar.gz
  • Upload date:
  • Size: 66.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.9

File hashes

Hashes for clize-4.2.1.tar.gz
Algorithm Hash digest
SHA256 3177a028e4169d8865c79af82bdd441b24311d4bd9c0ae8803641882d340a51d
MD5 b61f1f9d08841010ed15a62ddb215ccb
BLAKE2b-256 a4bea36c49d7d92d60de4a011ca0e5bdca9b3ecaf825337ff2e09244776ab0db

See more details on using hashes here.

File details

Details for the file clize-4.2.1-py2.py3-none-any.whl.

File metadata

  • Download URL: clize-4.2.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 71.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.6.0 importlib_metadata/4.8.2 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.61.1 CPython/3.6.9

File hashes

Hashes for clize-4.2.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 61dd0bbdb84b85fb8bbe31c19507a4400d175624f6a48b6c6e051a9b5b8be7e8
MD5 5d9fee3a172b059a3b39c320615668bb
BLAKE2b-256 8f9758a4c2ce225658d004f4c89c536911e70531c2a6a093b39ee0ac64c2ff06

See more details on using hashes here.

Release history Release notifications | RSS feed

5.0.2

2 files

5.0.1

2 files

5.0.0

2 files

This release

4.2.1 This release

2 files

4.2.0

2 files

4.1.2

2 files

4.1.1

2 files

4.1.0

2 files

4.0.4

2 files

4.0.3

2 files

4.0.2

2 files

4.0.1

2 files

4.0

2 files

3.1.0

2 files

3.0.1

2 files

3.0

2 files

2.4

1 file

2.2

1 file

2.1

1 file

2.0

1 file

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page