Simple utility functions for command-line applications.
Project description
This is a package containing utility functions for command-line applications.
Features
Inputting an integer, float or boolean
Selecting from a list of options (by entering an integer or character)
Goals
Simplicity: Straightforward, high-level functions with sensible defaults. Most parameters are optional, so you can hit the ground running.
Flexible: An extensive range of options are provided, making the library useful in a wide range of situations.
Installation
Install as usual:
pip install ruben-console-utilities
You may wish to create a virtual environment beforehand.
Usage
Here a few examples:
>>> import consoleutilities as cu >>> cu.input_option_int(["Export as PDF", "Export as HTML", "Export as TeX"]) [0]: Export as PDF [1]: Export as HTML [2]: Export as TeX Enter integer [0..2]: >? 0 0 >>> cu.input_int("Pick a number between 1 and 10: ", 1, 10, include_max=True) Pick a number between 1 and 10: >? 8 8 >>> cu.input_boolean("Specify whether to trust this host") Specify whether to trust this host [y/N]: >? abc123 False >>> cu.input_boolean("Specify whether to enable HTTPS", default=True) Specify whether to enable HTTPS [Y/n]: >? True
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
Built Distribution
Close
Hashes for ruben-console-utilities-0.2.2.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | 31bf141ceb16ee8ff307b156ed41f93ad36d97ff7006b2ee70397a74119e4a3d |
|
MD5 | 408923f53080d5e25a1b6ae2c03d5fe4 |
|
BLAKE2b-256 | f0e44561c1e1b55e8c3a8362a7dcc718c2f722e8cf7f3585822b7c7cfc59e4f8 |
Close
Hashes for ruben_console_utilities-0.2.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 570dc6913c3a74d62070c1434f400323ba52a62e3ac097a298b3404a8ae9994e |
|
MD5 | 4479fe18def26e875e186d40233757c6 |
|
BLAKE2b-256 | 756c735fea76d42cc0797d182aa7b7e6bee4f9cba9c80d683fee5fba412c7ac3 |