Skip to main content

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

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 GIT:

git clone https://github.com/KonstantinDigital/Inputx.git

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.2.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.2-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: inputx-1.0.2.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.2.tar.gz
Algorithm Hash digest
SHA256 27aee0757e14ab2e74a4a444fbf4cb9d0b55f33982b2f0da5f9b392362e5bb7f
MD5 858642a21fa7a4d9f132f280c84b711f
BLAKE2b-256 1dd357d699a7131844b07abf9db146a9e8b93c7aa8f93281558da00e5424cbcf

See more details on using hashes here.

File details

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

File metadata

  • Download URL: inputx-1.0.2-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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 e3ecb836feb6be20b82a04dfdf396fbaeb6d14650fe6a471621019805065f2ac
MD5 b613592b2fb6b50810e98df8cb9d2580
BLAKE2b-256 6fa5a99801601e526e8ff30235cb1f7a3957684d4b487eabb3660374ea26e341

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