Skip to main content

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 pip3 instead of pip.

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 form
  • description - The description of the form
  • content - The content of the form
Methods
  • show() - Show the form
  • get(name) - Get the value of a field
  • get_all() - Get all the values of the fields
  • set(name, value) - Set the value of a field
  • clear() - Clear all the values of the fields

Field

Parameters
  • name - The name of the field
  • value - 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 checkbox
  • question - The question of the checkbox
Methods
  • ask() - Ask the user for the value of the checkbox

Radio

Parameters
  • name - The name of the radio
  • question - The question of the radio
  • options - The options of the radio
Methods
  • ask() - Ask the user for the value of the radio

Select

Parameters
  • name - The name of the select
  • question - The question of the select
  • options - The options of the select
Methods
  • ask() - Ask the user for the value of the select

Password

Parameters
  • name - The name of the password
  • value - The value of the password
  • mask - 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

MIT License

Metadata

Release files for terminalforms 1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for terminalforms 1.2
File Size Uploaded Provenance
terminalforms-1.2.tar.gz 3.7 kB Without provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for terminalforms 1.2
File Interpreter ABI Platform
terminalforms-1.2-py3-none-any.whl Python 3 none any Details

Total release size: 7.7 kB

Release files / terminalforms-1.2.tar.gz

Download URL terminalforms-1.2.tar.gz
Size 3.7 kB
Tags Source
SHA-256 checksum
How to use checksums
56fc6f3eac0932cbfe7fa933edc42f3ee36e3164aab63bd9d97b8e14a1fa44c8
BLAKE2b-256 checksum
How to use checksums
d4cab83bc6c1cda53184c2ab2711fa03ecda7dc05d49f02015f28d2a8fed63ee
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Release files / terminalforms-1.2-py3-none-any.whl

Download URL terminalforms-1.2-py3-none-any.whl
Size 4.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
abb411bfbbcb44bc013d2be2ad2d1cbdc6f6b27a03ed64a73385d534b186d1cf
BLAKE2b-256 checksum
How to use checksums
2b93f72d9609e60817c743f5c38b8da9d3f16d654827fab94b7b36d77eba4f11
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.2 CPython/3.11.2

Security for terminalforms 1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.2 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page