Skip to main content

`inputx` is a Python module that provides an advanced input function with various validation options.

Reason this release was yanked:

When entering an empty value with data types such as int and float, an error occurred.

Project description

INPUTX

inputx is a Python module that provides an advanced input function with various validation options. It allows you to get user input in a flexible and secure way, supporting data types like int, float, and str, as well as restrictions on the types of characters allowed (e.g., only English letters, digits, symbols, etc.).

Features

  • Data type validation: Ensures input is of type int, float, or str.
  • Invisible input: Can hide user input (useful for passwords).
  • Character restrictions: Restrict input to specific sets of characters, such as:
    • Only English letters (a-z, A-Z)
    • Only Russian letters (а-я, А-Я)
    • Only digits (0-9)
    • Only symbols (e.g., !@#$%^&*)

Supported Platforms

Currently, this module supports only Windows operating system, because it using msvcrt for capturing user input. Other platforms (e.g., Linux, macOS) are not yet supported.

Installation

To install the package, use Poetry:

poetry add inputx

Or install directly from PyPI:

pip install inputx

USAGE

Basic Example

from inputx import inputx

# Get an integer input
age = inputx("Enter your age: ", data_type="int")
print(f"Your age is: {age}")

# Get a float input
price = inputx("Enter the price: ", data_type="float")
print(f"Price: {price}")

# Get a password (invisible input)
password = inputx("Enter your password: ", invisible_input=True)
print("Password entered successfully.")

Restrictions

You can use restrictions to limit the types of characters users can enter.

from inputx import inputx

# Only accept English letters
name = inputx("Enter your name: ", only_en_letters=True)

# Only accept digits and symbols
phone = inputx("Enter your phone number: ", only_digitals=True, only_symbols=True)

# Only accept symbols
symbols = inputx("Enter some symbols: ", only_symbols=True)

License

This project is licensed under the MIT License - see the LICENSE file for details.

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

inputx-1.0.0.tar.gz (4.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

inputx-1.0.0-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

Details for the file inputx-1.0.0.tar.gz.

File metadata

  • Download URL: inputx-1.0.0.tar.gz
  • Upload date:
  • Size: 4.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Windows/10

File hashes

Hashes for inputx-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2ca17ff9d86b7a2a8638c52fa666cadd8362f476b032017a101fbb57e1b7e381
MD5 3dbfc13482457db8ac147472f71c8686
BLAKE2b-256 a1a8c9cab13299988dd03dff9bb391dde9d3fda5ca6f7b5c5dfcc849b13dd8b0

See more details on using hashes here.

File details

Details for the file inputx-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: inputx-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 4.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.8.4 CPython/3.12.3 Windows/10

File hashes

Hashes for inputx-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 9655c186f3c918b6a39522e4ba2e7e15e07e2d68fa1e0afdf2a6e1cf6eabe27e
MD5 22aa0b62641b9fb036fde83e53819f9e
BLAKE2b-256 628969956d548ce6bffd56d3e89ac68ca2cb5017e7a70de8be5bc895bb3c8541

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page