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
Release files for ruben-console-utilities 0.3.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 | |
|---|---|---|---|
| ruben-console-utilities-0.3.0.tar.gz | 8.2 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ruben_console_utilities-0.3.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 16.9 kB
Release files / ruben-console-utilities-0.3.0.tar.gz
| Download URL | ruben-console-utilities-0.3.0.tar.gz |
|---|---|
| Size | 8.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2088803b9c462ce3f6fd27044adf9cffb3e2457176e1326b1b5c1ea4ef2623f6
|
|
BLAKE2b-256 checksum How to use checksums |
5e0d477c5ff38dceab311d16193fe9bfb9354c291405ba4cc2a260a679e3fad8
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|
Release files / ruben_console_utilities-0.3.0-py3-none-any.whl
| Download URL | ruben_console_utilities-0.3.0-py3-none-any.whl |
|---|---|
| Size | 8.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
42263b50f64a16e7574db62fc94c9f172ab34882e11c7292cd5c523090166081
|
|
BLAKE2b-256 checksum How to use checksums |
2773ef29cd0534e2b55159a4e35edab1bd96cbacb53855cf063064535dd25577
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/4.0.1 CPython/3.9.15
|