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
@grp('cli')
def cli():
"""base cli"""
pass
@cmd('hello')
@opt('--count', '-c', type=int, default=1, help='Number of greetings')
@opt('--name', '-n', type=str, help='The person to greet')
def hello(count: int, name: str):
"""Simple program that greets NAME for a total of COUNT times."""
for x in range(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.0.9.tar.gz
(8.0 kB
view hashes)