A simple framework to build a cli tool, base on Alconna
Reason this release was yanked:
bugs
Project description
Cli-Lite
A simple framework to build a cli tool. Base on Alconna
install
pip install cli-lite
example
write as sample:
from clilte import BaseCommand, CommandLine, CommandMetadata
from arclet.alconna import Alconna, Arparma, Args
class MyCommand(BaseCommand):
def init_plugin(self) -> Alconna:
return Alconna("hello", Args["name", str])
def dispatch(self, result: Arparma):
return print(f"Hello! {result.name}")
def meta(self) -> CommandMetadata:
return CommandMetadata("hello", "0.0.1", "my first plugin", ["dev"], ["john"])
if __name__ == '__main__':
cli = CommandLine(
"test",
"My first CLI",
"0.0.1"
)
cli.add(MyCommand)
cli.main()
and execute the line:
python test.py hello world
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
cli-lite-0.4.0.tar.gz
(2.2 kB
view details)
Built Distribution
File details
Details for the file cli-lite-0.4.0.tar.gz
.
File metadata
- Download URL: cli-lite-0.4.0.tar.gz
- Upload date:
- Size: 2.2 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.1.3 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 6d6ae937f233cbc699de19095c04d019f384adea1fa0df8e17efab9c6cb32402 |
|
MD5 | 98a8d3d0c3ab88e7e6773ee867596c12 |
|
BLAKE2b-256 | 461fb036d762088e319f1a3a86464d77a3805e8a91d475c3db0ad7d4907e2ad5 |
File details
Details for the file cli_lite-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: cli_lite-0.4.0-py3-none-any.whl
- Upload date:
- Size: 2.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: pdm/2.1.3 CPython/3.8.6
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | d6ca04dc2d5f08f29838fc69cd2ba0920b7334ecde29178442d55f374549dd03 |
|
MD5 | 90642ccd6c6bc3d94a296e8f1a599086 |
|
BLAKE2b-256 | 862898d4a88161f80b3ca4dc5d50a0309d7c412b266484fe2c5608d2104edce3 |