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.2.tar.gz (5.5 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.2-py3-none-any.whl (8.0 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: rynput-1.0.2.tar.gz
  • Upload date:
  • Size: 5.5 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.2.tar.gz
Algorithm Hash digest
SHA256 a2a74970dee5cbeaf9d53765ca7c29659a3caf3a88f4afd09d47feaeebe39fa2
MD5 b56bdb3bb7adc49cf686f426bef69ef9
BLAKE2b-256 e7e2db17ff2ce92f6c09bb0633e0b44f3b588f5f0335829e981e621666cc2171

See more details on using hashes here.

Provenance

The following attestation bundles were made for rynput-1.0.2.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.2-py3-none-any.whl.

File metadata

  • Download URL: rynput-1.0.2-py3-none-any.whl
  • Upload date:
  • Size: 8.0 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.2-py3-none-any.whl
Algorithm Hash digest
SHA256 a9f0ac60040148e3685f3099f9b2c2b46099b5ffdb669e6a0eccce84cf631e53
MD5 0317b65ca13be04e8f5f00ce463e08f5
BLAKE2b-256 3ac057f588f6f2e45a9dc8d41c67371bb5feada17587e67ab56f6a555d9d5ae2

See more details on using hashes here.

Provenance

The following attestation bundles were made for rynput-1.0.2-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