Skip to main content

Create CLIs with classes and type hints.

Project description

https://img.shields.io/pypi/v/cliar.svg https://travis-ci.org/moigagoo/cliar.svg?branch=develop https://codecov.io/gh/moigagoo/cliar/branch/develop/graph/badge.svg

Cliar

Create a CLI from a Python class, make it powerful with type hints.

Cliar is a Python tool that helps you create commandline interfaces:

from cliar import Cliar

class Git(Cliar):
    '''Git clone created with Cliar'''

    def clone(self, repo, dir='.'):
        '''Clone a git repo from REPO to DIR.'''

        print(f'Cloning from {repo} to {dir}')

if __name__ == '__main__':
    Git().parse()

Run the script:

$ python git.py clone http://foo.bar -d baz
Cloning from http://foo.bar to baz

Requirements

Cliar runs with Python 3.6+ on Windows, Linux, and Mac. There are no external dependencies.

Install

Install Cliar from PyPI with pip:

$ pip install cliar

Project details


Download files

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

Source Distribution

cliar-1.2.0.tar.gz (4.4 kB view hashes)

Uploaded Source

Built Distribution

cliar-1.2.0-py3-none-any.whl (12.6 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page