A python CLI framework base on argparse, supporting: config system, command-completion, rich-text log and so on.
Project description
Pyclier
A python CLI framework base on argparse, supporting: config system, command-completion, rich-text log, friendly help message prompt and so on.
Note: This project was created with Cookiecutter and the
zhangxianbing/cookiecutter-pypackage
project template.
Features
- support friendly help message prompt
- support configuration file parsing system
- support easy-to-use interface for building complex CLI program
- support rich-text and flexible log system (base on rich)
- support command auto-completion (base on argcomplete)
- support auto generating and updating usage (based on auto-usage)
- support updating CLI program
Quick Start
Installation
pip install pyclier
For using auto completion, you should first install argcomplete and the activate it:
pip install argcomplete
activate-global-python-argcomplete
Then add the following lines in your setup.py:
from setuptools import setup
setup(...)
# post installation
from pyclier.setuptools import copytree, enable_complete
command = sys.argv[-1]
if command == "install":
copytree("conf", appdirs.user_config_dir(prog_name))
enable_complete(prog_name)
import pip
pip.main(["install", ".", "-U", "--no-index"])
Run demo
cd pyclier-demo && make install
# then refresh your bash environment
pyclier -h
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
pyclier-2.0.0.tar.gz
(24.6 kB
view hashes)
Built Distribution
pyclier-2.0.0-py3-none-any.whl
(20.5 kB
view hashes)