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

Uploaded Python 3

File details

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

File metadata

  • Download URL: inputx-1.0.1.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.1.tar.gz
Algorithm Hash digest
SHA256 7fcf394df7f6140c75e3165fc1a1979deca7353375ce1f41f23e4df84dfd5ada
MD5 fad4d043490642fc9c6b5e85233e51c6
BLAKE2b-256 69b24168e8c6d59e258eccb12f4e92addb365293f335f5376babad3ba1b7c717

See more details on using hashes here.

File details

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

File metadata

  • Download URL: inputx-1.0.1-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.1-py3-none-any.whl
Algorithm Hash digest
SHA256 608a23442b2f83026390f41299d597129f4a5feb66f9125d7abef83b4f1e337d
MD5 d5a59cf65072d6073e63a9053e7705f5
BLAKE2b-256 713c2739d2e75bc32614133f2cb900ca2601d6239b71aaa3b8131d890c97cb45

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