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.3.tar.gz (4.6 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.3-py3-none-any.whl (4.8 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: inputx-1.0.3.tar.gz
  • Upload date:
  • Size: 4.6 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.3.tar.gz
Algorithm Hash digest
SHA256 a0338c60864f29d8245a2ed2f4e689185fa81747d5ee2e4869a1fc99b34c2894
MD5 5b481f9abf44c51a1fc3aaccb4e158dc
BLAKE2b-256 411a3a919926e4f69aa2b42ff9e0f0621107ef08060e533a71e34ef76406fc9d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: inputx-1.0.3-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.3-py3-none-any.whl
Algorithm Hash digest
SHA256 8930e3de0ec9621a36ca8c5873e9c1a7cac1cc6b29f3344a5f1e07cf4e8e4770
MD5 55bc5d8e8eb0d8ddb80d95fc51865815
BLAKE2b-256 111b6cae66bf6c4c7fdaf452920e03e03675e682262a23ac16145ec149f8b1a8

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