Skip to main content

Python tools for typed input validation.

Project description

Rynput

Python tools for strongly typed input validation.

Description

Rynput is focused on validating strings and converting them to a specific type, if possible. It is particularily effective when configuring a large list of properties which may have very different requirements for their values.

Installation

Run pip install rynput.

Usage

It is recommended to use the following import statement:

from rynput import Property, PropertyGroup, validators

From there, create the list of properties to validate. The constructor for Property takes a name (str), type (Validator), and optionally a default value and description. Omitting a default value means that the property is marked as "required," and thus cannot be omitted by the input method.

properties = PropertyGroup([
    Property("Option", validators.Option(["Foo", "Bar", "Baz"]), "Foo"), # Default value provided
    Property("Integer", validators.Integer(4, 8)), # Required
    ...
])

The input strings may come from anywhere. However, typical examples may include a user configuration wizard (see examples/input_example.py) or from a config file (examples/json_example.py).

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

rynput-1.0.3.tar.gz (5.3 kB view details)

Uploaded Source

Built Distribution

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

rynput-1.0.3-py3-none-any.whl (7.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rynput-1.0.3.tar.gz
  • Upload date:
  • Size: 5.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rynput-1.0.3.tar.gz
Algorithm Hash digest
SHA256 00161e58821f34314a980e77b776c4f6e85bcde47877e1db7f95e40015c4e213
MD5 451e539f10feeb062c22627ac051a493
BLAKE2b-256 42cbf0693c36b317eea7ad66e55e830c53a02e755204e8fcb80461d3ecd56711

See more details on using hashes here.

Provenance

The following attestation bundles were made for rynput-1.0.3.tar.gz:

Publisher: python-publish.yml on jacob-thomas7/rynput

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

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

File metadata

  • Download URL: rynput-1.0.3-py3-none-any.whl
  • Upload date:
  • Size: 7.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.7

File hashes

Hashes for rynput-1.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 0b73854580c09260c7515334b2a1e76680f1679e915d1816c5f7c20911e6d8ca
MD5 60b85b22463bcca4114371c9fef4d4b5
BLAKE2b-256 e080a5315ffd038abdcc659ae17285fbc37657f4bfec471dc7f2185100bc0c7a

See more details on using hashes here.

Provenance

The following attestation bundles were made for rynput-1.0.3-py3-none-any.whl:

Publisher: python-publish.yml on jacob-thomas7/rynput

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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