GithubHelp home page GithubHelp logo

sean2077 / pyclier Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 66 KB

A python CLI framework base on argparse, supporting: config system, command-completion, rich-text log, friendly help message prompt and so on.

License: Apache License 2.0

Makefile 7.66% Python 92.34%
argparse python-cli-framework config-parser autocompletion richtext easy-to-use friendly

pyclier's Introduction

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

pyclier's People

Contributors

sean2077 avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.