Skip to main content

Command Line Object Chaining (cloc) - Modern cli framework for simple and complex cli applications

Project description

Command Line Object Chaining - cloc

MIT badge Python3.6 badge Platform badge

Modern cli framework for simple and complex cli applications

ToC

Requirements

  • System

    • Python 3.6+
  • Python Pip

    • requests

Installation

Virtual Environment is recommended

$ git clone https://www.github.com/tannerburns/cloc
$ cd cloc
$ pip3 install .

Information

Command line framework for making simple and complex command line applications.
  • Easily group commands together
  • Connect commands with classes for querysets
  • Create command line viewsets for abstracting user interaction on command querysets

Examples

from cloc import cmd, grp, opt
from cloc.types import IntRange

@grp('cli')
def cli():
    """base cli"""
    pass

@cmd('hello')
@opt('--count', '-c', type=IntRange, default=1, help='Number of greetings: ex -c 0,5 OR -c 5')
@opt('--name', '-n', type=str, help='The person to greet')
def hello(count: IntRange, name: str):
    """Simple program that greets NAME for a total of COUNT times."""
    for _ in count:
        print(f'Hello {name!r}')

if __name__ == '__main__':
    cli.add_command(hello)
    cli()

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

cloc-0.1.1.tar.gz (8.2 kB view details)

Uploaded Source

File details

Details for the file cloc-0.1.1.tar.gz.

File metadata

  • Download URL: cloc-0.1.1.tar.gz
  • Upload date:
  • Size: 8.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/45.0.0 requests-toolbelt/0.9.1 tqdm/4.43.0 CPython/3.7.3

File hashes

Hashes for cloc-0.1.1.tar.gz
Algorithm Hash digest
SHA256 3e81df92095474dffa5c68d8ac478480174a72deab715ed96bc171138bafda9d
MD5 fd86b5b2cc320daec2009258714af9ba
BLAKE2b-256 5968c01a6f13f51b66abe0a6253ddde23cecdc5ebbd2e99c0b05ea9585894d62

See more details on using hashes here.

Supported by

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