Command Line Object Chaining (cloc) - Modern cli framework for simple and complex cli applications
Project description
Command Line Object Chaining - cloc
Modern cli framework for simple and complex cli applications
ToC
Requirements
-
System
- Python 3.6+
-
Python Pip
- requests
- 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
Release history Release notifications | RSS feed
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.0.tar.gz
(8.2 kB
view hashes)