Skip to main content

快速构建自己的命令行工具包。 Quickly develop your command line interface(CLI) toolkit.

Project description

likeshell

PyPI version Supported Versions Apache License

Actions Status codecov

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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

likeshell-1.0.0.tar.gz (17.7 kB view details)

Uploaded Source

Built Distribution

likeshell-1.0.0-py3-none-any.whl (18.8 kB view details)

Uploaded Python 3

File details

Details for the file likeshell-1.0.0.tar.gz.

File metadata

  • Download URL: likeshell-1.0.0.tar.gz
  • Upload date:
  • Size: 17.7 kB
  • Tags: Source
  • Uploaded using 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

File hashes

Hashes for likeshell-1.0.0.tar.gz
Algorithm Hash digest
SHA256 5dca2a0e1b669763bc0be5ee4143edb32348baeab5b3f41000f258c71b4c8b2f
MD5 09df3c7b8cacc064f8732e0719dd34af
BLAKE2b-256 deade3db0848f0ec3555f14c26995a8c32c3b74da0660024cf3d1bf1f4a3a3fb

See more details on using hashes here.

File details

Details for the file likeshell-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: likeshell-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 18.8 kB
  • Tags: Python 3
  • Uploaded using 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

File hashes

Hashes for likeshell-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 c6ccfa5e5a3b46cc53f3156a76b604c22e76b18c42461c3eccc18b62b95a5c7d
MD5 16f74ca88ee044e2b76b9e43ec8240da
BLAKE2b-256 7d86685339e3134887b7aa883bb64c949eccd59373196cd8735e01a2eff0913e

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page