Prompting - the fancy way
Project description
ItsPrompt
Do you ever feel the need to ask a user of your code for an input?
Using input()
is easy, but is it great?
Do you want to give the user a selection list, a yes-or-no question, or maybe a multiline input field?
And do you think all of this should be done easily, without caring to much how it all works?
Then you are right here! ItsPrompt allows you to ask the user for input, the fancy way.
ItsPrompt tries to be an easy-to-use module for managing prompts for the user. Your task is to create a great program, not finding yourself questioning how to ask the user for input. That is why ItsPrompt is there to take care of this problem, so you can focus on the important things!
TOC
A small, thankful note
This project is not the first to accomplish the above-mentioned tasks. There is another package, PyInquirer
, which
inspired me to build ItsPrompt.
On my way to create a small program I came to a point were I needed a simple GUI, and I tried PyInquirer
.
Unfortunately, at the current time it is not actively maintained and a bit outdated. I thought of updating it, but then
I thought "Isn't it easier to just create my own version?" - And so I did!
ItsPrompt is not a copy or a fork of PyInquirer
. I built this module from the ground up, without ever looking deep
into the source code of PyInquirer
.
On my way to build this package, I learned a lot about prompt-toolkit
, and all of this just because of PyInquirer
!
Thanks!
Features
- many prompt types:
- select
- raw_select
- expand
- checkbox
- confirm
- input
- table
- prompt autocompletion and validation
- customizable style with
prompt_toolkit
- a helpful toolbar with error messages
- simple, pythonic syntax
Installation
This package is hosted on pypi, so the installation is as simple as it can get:
python3 -m pip install ItsPrompt
This will install ItsPrompt
without pandas. If you want to use TablePrompt
(see table) with
pandas.DataFrame
, you can install pandas support either by:
- installing pandas separately
- install
ItsPrompt
viapip install ItsPrompt[df]
Quick Example
Import the Prompt
class:
from ItsPrompt.prompt import Prompt
Now you can ask the user any type of prompt by calling the specific function from the Prompt
class, e.g.:
result = Prompt.input('What is your name?')
print(result)
You see how easy it is?
Usage
To learn more about the usage, visit our documentation.
Further Information
Visit our documentation to learn more about the usage of ItsPrompt!
If you need some easy examples, refer to example.py!
If you want to contribute, check out the projects repository: ItsPrompt!
If you got any other questions, or want to give an idea on how to improve ItsPrompt:
- visit our discussions: ItsPrompt Discussions!
- join our discord: TheItsProjects!
Puh, that was so much to read... But now, lets have fun with ItsPrompt!
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
File details
Details for the file itsprompt-1.5.tar.gz
.
File metadata
- Download URL: itsprompt-1.5.tar.gz
- Upload date:
- Size: 19.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | e1d563ed007037553c1ab9e5918c920f6705e75157e3b70ae613fa0f5fe0bc0f |
|
MD5 | 9a7e119f6a4b18e870ad08d6a3fe9169 |
|
BLAKE2b-256 | 9fd9adc54e68b260fb2695377203aa1021e0bb37a9a838a565b46fa62ad09983 |
File details
Details for the file ItsPrompt-1.5-py3-none-any.whl
.
File metadata
- Download URL: ItsPrompt-1.5-py3-none-any.whl
- Upload date:
- Size: 30.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/5.0.0 CPython/3.9.19
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | ced710ecc76e16d4b64572d88fb3db0d0c1f068dde26de41fc89193e2a736dc1 |
|
MD5 | 81e9ff30864645f1af91a1fa1111d19e |
|
BLAKE2b-256 | e9b60663c9424a7152d9b00b045164a5d45331d6350600cc2413ed3fe5663f09 |