All Projects β†’ epsy β†’ Clize

epsy / Clize

Licence: other
CLIze: Turn Python functions into command-line interfaces

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Clize

Typescript To Cli
Transform your typescript module into a CLI
Stars: ✭ 101 (-76.99%)
Mutual labels:  cli, argument-parser
Sywac
🚫 🐭 Asynchronous, single package CLI framework for Node
Stars: ✭ 109 (-75.17%)
Mutual labels:  cli, argument-parser
Argh
Argh! A minimalist argument handler.
Stars: ✭ 752 (+71.3%)
Mutual labels:  cli, argument-parser
Clipp
easy to use, powerful & expressive command line argument parsing for modern C++ / single header / usage & doc generation
Stars: ✭ 687 (+56.49%)
Mutual labels:  cli, argument-parser
Argparse
Argparse for golang. Just because `flag` sucks
Stars: ✭ 294 (-33.03%)
Mutual labels:  cli, argument-parser
Yaap
Yet Another (Swift) Argument Parser
Stars: ✭ 124 (-71.75%)
Mutual labels:  cli, argument-parser
Clikt
Multiplatform command line interface parsing for Kotlin
Stars: ✭ 1,658 (+277.68%)
Mutual labels:  cli, argument-parser
Caporal.js
A full-featured framework for building command line applications (cli) with node.js
Stars: ✭ 3,279 (+646.92%)
Mutual labels:  cli, argument-parser
Lyra
A simple to use, composable, command line parser for C++ 11 and beyond
Stars: ✭ 238 (-45.79%)
Mutual labels:  cli, argument-parser
Deno Cliffy
Command line framework for deno πŸ¦• Including Commandline-Interfaces, Prompts, CLI-Table, Arguments Parser and more...
Stars: ✭ 149 (-66.06%)
Mutual labels:  cli, argument-parser
Getopt Php
A PHP library for command-line argument processing
Stars: ✭ 305 (-30.52%)
Mutual labels:  cli, argument-parser
Fire Hpp
Fire for C++: Create fully functional CLIs using function signatures
Stars: ✭ 395 (-10.02%)
Mutual labels:  cli, argument-parser
Aws Google Auth
Provides AWS STS credentials based on Google Apps SAML SSO auth (what a jumble!)
Stars: ✭ 428 (-2.51%)
Mutual labels:  cli
Create React Library
⚑CLI for creating reusable react libraries.
Stars: ✭ 4,554 (+937.36%)
Mutual labels:  cli
React Blessed
A react renderer for blessed.
Stars: ✭ 4,204 (+857.63%)
Mutual labels:  cli
Win Acme
A simple ACME client for Windows (for use with Let's Encrypt et al.)
Stars: ✭ 4,305 (+880.64%)
Mutual labels:  cli
X Build
πŸ–– Customizable front-end engineering scaffolding tools
Stars: ✭ 436 (-0.68%)
Mutual labels:  cli
Npkill
List any node_modules directories in your system, as well as the space they take up. You can then select which ones you want to erase to free up space.
Stars: ✭ 5,325 (+1112.98%)
Mutual labels:  cli
Plop
Consistency Made Simple
Stars: ✭ 4,765 (+985.42%)
Mutual labels:  cli
Promptui
Interactive prompt for command-line applications
Stars: ✭ 4,621 (+952.62%)
Mutual labels:  cli

Clize


.. image:: https://readthedocs.org/projects/clize/badge/?version=stable :target: http://clize.readthedocs.io/en/stable/?badge=stable :alt: Documentation Status .. image:: https://readthedocs.org/projects/clize/badge/?version=latest :target: http://clize.readthedocs.io/en/latest/?badge=latest :alt: Documentation Status .. image:: https://badges.gitter.im/Join%20Chat.svg :alt: Join the chat at https://gitter.im/epsy/clize :target: https://gitter.im/epsy/clize?utm_source=badge&utm_medium=badge&utm_campaign=pr-badge&utm_content=badge .. image:: https://travis-ci.org/epsy/clize.svg?branch=master :target: https://travis-ci.org/epsy/clize .. image:: https://coveralls.io/repos/epsy/clize/badge.svg?branch=master :target: https://coveralls.io/r/epsy/clize?branch=master

Clize is an argument parser for Python <https://www.python.org/>_. 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:

.. 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 decorators <http://clize.readthedocs.io/en/stable/reference.html#named-param-py2>_.

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

.. code-block:: console

$ 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 http://clize.readthedocs.io/

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].