A command line interface package.
Project description
CLIpy
A python package that eases the creation of command line interface tools. It's a simple wrapper around the argparse module that simplifies the creation of CLI tools.
Features
- Simplifies the creation of CLI tools.
- Supports
argparsearguments. @clipy.Appdecorator: Adds a command-line parser with usage and description.@clipy.Commanddecorator: Adds a command to the command-line parser.@clipy.Optiondecorator: Adds an option to the command-line parser.
Usage
import clipy
@clipy.App(usage="mypackage <command> [options] [arg] ...", description="A CLI app")
@clipy.Option("option1", help="A global option")
@clipy.Command("command1", usage="mypackage command1 [options] [arg] ...", description="A descritpion", options=[
clipy.Option("option2", help="Help message"),
clipy.Option("flag", help="Help message", action="store_true")
])
@clipy.Command("command2", usage="mypackage command2 [options] [arg] ...", description="A descritpion", options=[
clipy.Option("option3", help="Help message", required=True)
])
def main(command: clipy.CommandDefinition):
print(f"Command: {command.name}")
print("Options:")
for key, value in command.options.items():
print(f" {key}: {value}")
if __name__ == "__main__":
main() # pylint: disable=missing-kwoa
Then enjoy your CLI tool:
python script.py --help
python script.py --global-option1 arg1 --global-option2 arg2
python script.py command1 --help
python script.py --global-option command1 --option1 arg1
Installation
pip install clipyx
From Github:
pip install git+https://github.com/G-Lauz/clipy.git@v0.1.0-pre0
Or clone the repository and install it manually:
git clone https://github.com/G-Lauz/clipy.git
cd clipy
pip install .
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
clipyx-0.2.0.tar.gz
(8.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file clipyx-0.2.0.tar.gz.
File metadata
- Download URL: clipyx-0.2.0.tar.gz
- Upload date:
- Size: 8.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
b56302f2b687d78d146d9d9d2c4498a696ee00cebf91193a8e00f78b7c42f97a
|
|
| MD5 |
6bdc0a01e3ddfe2484482651e673a1d9
|
|
| BLAKE2b-256 |
4af385f8a2ea57f26d64c4d286164853ac69ca043e9d06d429d540c413d8532c
|
File details
Details for the file clipyx-0.2.0-py3-none-any.whl.
File metadata
- Download URL: clipyx-0.2.0-py3-none-any.whl
- Upload date:
- Size: 8.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.9.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
c40ee2a8d090e2bf18305ee73a0c31de2f987f277124a11ac02b4cfdec417498
|
|
| MD5 |
b12cb5bcf4bd8ec558469d82a69d800b
|
|
| BLAKE2b-256 |
edb18f28d7746a2ae0138e92546b018d317bd162719e9fb1c8b11ab09e4462eb
|