Interactive command line tool.
Project description
Interactive command line tool.
Github repo: https://github.com/caizhengxin/interact-cli
Documentation: https://interact-cli.readthedocs.io
Free software: BSD
Features
Interact input
Supports multiple data types
Support input check
Support type
boolean
string
int
float
list
choice
Installation
To install interact-cli, run this command in your terminal:
$ pip3 install interact-cli
or:
$ git clone https://github.com/caizhengxin/interact-cli.git
$ cd interact-cli
$ pip3 install -e .
Demo
Your Project name [interact-cli]:
Project description [Interactive command line tool.]:
Your name [jankincai]:
Your email [jankincai12@gmail.com]:
Project version [0.1.0]:
Use code hosting platform [n]: y
Select code hosting:
1 - github
2 - gitee
3 - gitlab
Choose from [1]:
Your code hosting username [jankincai]:
See demo
Usage
See interact.json
interact:
from interact import interact
if __name__ == "__main__":
obj = interact("interact.json")
print(obj)
print(obj.version)
interacts:
from interact import interacts
config = {
"project_name": {
"type": "string",
"default": "interact-cli",
"description": "Your Project name"
},
"description": {
"type": "string",
"default": "Interactive command line tool.",
"description": "Project description"
},
"author": {
"type": "string",
"default": "jankincai",
"description": "Your name"
},
"email": {
"type": "string",
"default": "jankincai12@gmail.com",
"description": "Your email"
},
"version": {
"type": "string",
"default": "0.1.0",
"description": "Project version"
},
"use_code_hosting": {
"type": "boolean",
"default": True,
"description": "Use code hosting platform"
},
"code_hosting": {
"type": "choice",
"default": 1,
"choice": [
"github",
"gitee",
"gitlab"
],
"description": "Code hosting",
"when": "use_code_hosting == true"
},
"code_hosting_username": {
"type": "string",
"default": "jankincai",
"description": "Your code hosting username",
"when": "use_code_hosting == true"
}
}
if __name__ == "__main__":
obj = interacts(config)
print(obj)
print(obj.version)
load:
from interact import load
if __name__ == "__main__":
print(load("interact.json"))
loads:
from interact import loads
if __name__ == "__main__":
print(loads(config))
Credits
This package was created with Cookiecutter and the caizhengxin/cookiecutter-package project template.
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
interact-cli-0.2.0.tar.gz
(8.0 kB
view hashes)
Built Distribution
Close
Hashes for interact_cli-0.2.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | ae8199a8b9ee9327aaf5d2415e0db76f75835b049293dc2b22fd5a9c2116ab9e |
|
MD5 | 5b8b4f5c6310b848c2c2b3507527a6b7 |
|
BLAKE2b-256 | cc2b8b30362c4d77faa332cffb3f6a111c8021412e39ec71aca3bd5065aa32ad |