ask_lib
ask_lib is a small Python package available on PyPi that lets you ask user's confirmation from a CLI.
Documentation
You can take a look to the documentation, hosted by ReadTheDocs.
Features
- Simple API.
- No dependencies.
- Well tested.
- Featuring CI.
Install
pip install ask_lib
# Or, if you are using poetry
poetry add ask_lib
Examples
from ask_lib import ask, AskResult
to_remove = "file.txt"
if ask("Are you sure to delete this file ?", AskResult.NO):
os.remove(to_remove)
import os
import sys
from ask_lib import ask, AskResult
yes_to_all = AskFlag.YES_TO_ALL if "-force" in sys.argv else None
to_remove = "file.txt"
if ask("Are you sure to delete this file ?", flag=yes_to_all):
os.remove(to_remove)
Metadata
Release files for ask-lib 2.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| ask_lib-2.0.1.tar.gz | 3.0 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| ask_lib-2.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.8 kB
Release files / ask_lib-2.0.1.tar.gz
| Download URL | ask_lib-2.0.1.tar.gz |
|---|---|
| Size | 3.0 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
e3b7027e2d498b06e82aa164a0cd38c88c152fcc5fed42a591ad6f416c8015dd
|
|
BLAKE2b-256 checksum How to use checksums |
053529b840e4ee1f24fdfa77ff16670aa2ec0f9d5124b089b0a22bf57988796f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Linux/6.2.0-24-generic
|
Release files / ask_lib-2.0.1-py3-none-any.whl
| Download URL | ask_lib-2.0.1-py3-none-any.whl |
|---|---|
| Size | 3.8 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
6ce6408b7de64236042abc84b9f08eddb8bcbff278a61b1c4812bbf0a7e5e85b
|
|
BLAKE2b-256 checksum How to use checksums |
58b4a0800d506a023649cb31c4bdc3724c51e6c1dcaf500525143bd71e8bc160
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.5.1 CPython/3.11.2 Linux/6.2.0-24-generic
|