Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/sean2077/pyclier
A python CLI framework base on argparse, supporting: config system, command-completion, rich-text log, friendly help message prompt and so on.
https://github.com/sean2077/pyclier
argparse autocompletion config-parser easy-to-use friendly python-cli-framework richtext
Last synced: 8 days ago
JSON representation
A python CLI framework base on argparse, supporting: config system, command-completion, rich-text log, friendly help message prompt and so on.
- Host: GitHub
- URL: https://github.com/sean2077/pyclier
- Owner: sean2077
- License: apache-2.0
- Created: 2021-05-21T12:13:45.000Z (over 3 years ago)
- Default Branch: main
- Last Pushed: 2021-11-30T14:39:49.000Z (almost 3 years ago)
- Last Synced: 2024-11-08T06:48:36.623Z (12 days ago)
- Topics: argparse, autocompletion, config-parser, easy-to-use, friendly, python-cli-framework, richtext
- Language: Python
- Homepage:
- Size: 64.5 KB
- Stars: 1
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# Pyclier
A python CLI framework base on [argparse](https://docs.python.org/3/library/argparse.html), supporting: config system, command-completion, rich-text log, friendly help message prompt and so on.
> Note: This project was created with [Cookiecutter](https://github.com/cookiecutter/cookiecutter) and the [`zhangxianbing/cookiecutter-pypackage`](https://github.com/zhangxianbing/cookiecutter-pypackage) project template.
## Features
- [x] support friendly help message prompt
- [x] support configuration file parsing system
- [x] support easy-to-use interface for building complex CLI program
- [x] support rich-text and flexible log system (base on [rich](https://github.com/willmcgugan/rich))
- [x] support command auto-completion (base on [argcomplete](https://github.com/kislyuk/argcomplete))
- [ ] support auto generating and updating usage (based on [auto-usage](https://github.com/zhangxianbing/auto-usage))
- [ ] support updating CLI program## Quick Start
### Installation
```bash
pip install pyclier
```
For using auto completion, you should first install [argcomplete](https://github.com/kislyuk/argcomplete) and the activate it:
```bash
pip install argcomplete
activate-global-python-argcomplete
```Then add the following lines in your setup.py:
```py
from setuptools import setupsetup(...)
# 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
```bash
cd pyclier-demo && make install
# then refresh your bash environment
pyclier -h
```