快速构建自己的命令行工具包。 Quickly develop your command line interface(CLI) toolkit.
Project description
likeshell
likeshell 快速构建自己的命令行工具,扩展性强、可配置、开箱即用、干净整洁, 只需一步构建自己的CLI。
要求
Python >= 3.6
安装
使用pip安装
$ pip install likeshell
简单使用
创建demo.py文件
import likeshell
class MyTasks(likeshell.Shell):
def task1(
self,
s1: str, # 不指定类型则不校验
i1: int,
f1: float
):
print('run test1')
print(f's1 is {s1}')
print(f'i1 is {i1}')
print(f'f1 is {f1}')
def task2(self):
print('run test2')
>> python demo.py task1 str1 100 10.01
<< run test1
s1 is str1
i1 is 100
f1 is 10.01
>> python demo.py task1
<< ValueError: Miss parameter "s1"
>> python demo.py task1 str1 str2 str3
<< TypeError: "str2" is not a int
>> python demo.py task2
<< run test2
功能文档
基础功能
高级功能
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
likeshell-0.0.8.tar.gz
(16.2 kB
view hashes)
Built Distribution
likeshell-0.0.8-py3-none-any.whl
(18.3 kB
view hashes)
Close
Hashes for likeshell-0.0.8-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 69a98760d5139002ce32178ffe9e879f8cdbda4197b486128e7106968a0f2b92 |
|
MD5 | 13f6b36fa2c074272e382deb27c52ab3 |
|
BLAKE2b-256 | bd5c1c13d20d9b3b5e48c8f52ca2f82d07d6fd82baa443600744baf8659cc933 |