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
功能文档
基础功能
高级功能
Metadata
Release files for likeshell 1.0.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| likeshell-1.0.0.tar.gz | 17.7 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| likeshell-1.0.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 36.5 kB
Release files / likeshell-1.0.0.tar.gz
| Download URL | likeshell-1.0.0.tar.gz |
|---|---|
| Size | 17.7 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5dca2a0e1b669763bc0be5ee4143edb32348baeab5b3f41000f258c71b4c8b2f
|
|
BLAKE2b-256 checksum How to use checksums |
deade3db0848f0ec3555f14c26995a8c32c3b74da0660024cf3d1bf1f4a3a3fb
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10
|
Release files / likeshell-1.0.0-py3-none-any.whl
| Download URL | likeshell-1.0.0-py3-none-any.whl |
|---|---|
| Size | 18.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
c6ccfa5e5a3b46cc53f3156a76b604c22e76b18c42461c3eccc18b62b95a5c7d
|
|
BLAKE2b-256 checksum How to use checksums |
7d86685339e3134887b7aa883bb64c949eccd59373196cd8735e01a2eff0913e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/3.4.1 importlib_metadata/4.0.1 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.60.0 CPython/3.7.10
|