Add forms to your terminal applications
Project description
TerminalForms
Add forms to your terminal applications
Installation
pip install terminal forms
note: Depending on your python installation, the command mayt vary. For example, if you are using python3, you may need to use
pip3instead ofpip.
Usage
from terminalforms import Form, Field, Checkbox, Radio, Select, Text, Password, Submit
form = Form(
title="Example Form",
description="Please fill out the following information:",
content=[
Text("Welcome to the example form!"),
Field("Name"),
Checkbox("Agreement", "Do you agree to the terms and conditions?"),
Select("Fruit", "Select your favorite fruit:", ["Apple", "Banana", "Orange"]),
Radio("Gender", "Select your gender:", ["Male", "Female", "Other"]),
Password("Password"),
Submit("Submit")
]
)
form.show()
answers = form.get_all()
print(answers)
name = form.get("Name")
print(name)
Documentation
Form
Parameters
title- The title of the formdescription- The description of the formcontent- The content of the form
Methods
show()- Show the formget(name)- Get the value of a fieldget_all()- Get all the values of the fieldsset(name, value)- Set the value of a fieldclear()- Clear all the values of the fields
Field
Parameters
name- The name of the fieldvalue- The value of the field
Methods
ask()- Ask the user for the value of the field
Text
Parameters
text- The text of the text
Methods
text()- Show the text
Checkbox
Parameters
name- The name of the checkboxquestion- The question of the checkbox
Methods
ask()- Ask the user for the value of the checkbox
Radio
Parameters
name- The name of the radioquestion- The question of the radiooptions- The options of the radio
Methods
ask()- Ask the user for the value of the radio
Select
Parameters
name- The name of the selectquestion- The question of the selectoptions- The options of the select
Methods
ask()- Ask the user for the value of the select
Password
Parameters
name- The name of the passwordvalue- The value of the passwordmask- The mask of the password
Methods
ask()- Ask the user for the value of the password
Submit
Parameters
name- The name of the submit
Methods
ask()- Ask the user for the value of the submit
License
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
terminalforms-1.2.tar.gz
(3.7 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file terminalforms-1.2.tar.gz.
File metadata
- Download URL: terminalforms-1.2.tar.gz
- Upload date:
- Size: 3.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
56fc6f3eac0932cbfe7fa933edc42f3ee36e3164aab63bd9d97b8e14a1fa44c8
|
|
| MD5 |
7e2c7086a78837b550b41b7121abd7ee
|
|
| BLAKE2b-256 |
d4cab83bc6c1cda53184c2ab2711fa03ecda7dc05d49f02015f28d2a8fed63ee
|
File details
Details for the file terminalforms-1.2-py3-none-any.whl.
File metadata
- Download URL: terminalforms-1.2-py3-none-any.whl
- Upload date:
- Size: 4.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.2 CPython/3.11.2
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
abb411bfbbcb44bc013d2be2ad2d1cbdc6f6b27a03ed64a73385d534b186d1cf
|
|
| MD5 |
37689a007b01c46e21577105fc4015d7
|
|
| BLAKE2b-256 |
2b93f72d9609e60817c743f5c38b8da9d3f16d654827fab94b7b36d77eba4f11
|