Skip to main content

Directed inputs class consumes and processes inputs from sources beyond args and kwargs

Project description

Directed Inputs Class

Directed Inputs Class Logo

🛠️ Manage your Python inputs efficiently! 🎯

CI Status Documentation Status PyPI Package latest release Supported versions

Directed Inputs Class is a Python library that provides a flexible and robust interface for managing inputs from various sources such as environment variables, stdin, and predefined dictionaries. It offers features like input freezing, thawing, and advanced decoding utilities.

Key Features

  • 🧩 Environment Variable Integration - Seamlessly integrates environment variables into your inputs.
  • 🧭 Scoped Environment Loading - Filter environment variables by prefix and optionally strip it for clean keys.
  • 📥 Stdin Input Handling - Read and merge inputs from stdin with optional overrides.
  • ❄️ Input Freezing and Thawing - Freeze inputs to prevent modifications, and thaw them when needed.
  • 🔄 Advanced Decoding Utilities - Decode inputs from Base64, JSON, and YAML formats with error handling.
  • 🔧 Type Conversion - Convert inputs to boolean or integer types with robust error handling.
  • 🧬 Deep Input Merging - Merge additional inputs into existing state without losing nested structure.

Example Usage

from directed_inputs_class import DirectedInputsClass

# Initialize with environment variables and stdin
dic = DirectedInputsClass(from_environment=True, from_stdin=True)

# Retrieve and decode an input
decoded_value = dic.decode_input("example_key", decode_from_base64=True)
print(decoded_value)

Freezing and Thawing Inputs

from directed_inputs_class import DirectedInputsClass

# Initialize with some inputs
dic = DirectedInputsClass(inputs={"key1": "value1"})

# Freeze the inputs
frozen_inputs = dic.freeze_inputs()
print(frozen_inputs)  # Outputs: {'key1': 'value1'}

# Thaw the inputs
thawed_inputs = dic.thaw_inputs()
print(thawed_inputs)  # Outputs: {'key1': 'value1'}

# Merge additional data safely
dic.merge_inputs({"feature_flags": {"new": True}})

For more usage examples, see the Usage documentation.

Contributing

Contributions are welcome! Please see the Contributing Guidelines for more information.

Project Links

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

directed_inputs_class-202511.2.tar.gz (7.5 kB view details)

Uploaded Source

Built Distribution

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

directed_inputs_class-202511.2-py3-none-any.whl (6.3 kB view details)

Uploaded Python 3

File details

Details for the file directed_inputs_class-202511.2.tar.gz.

File metadata

  • Download URL: directed_inputs_class-202511.2.tar.gz
  • Upload date:
  • Size: 7.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for directed_inputs_class-202511.2.tar.gz
Algorithm Hash digest
SHA256 23e3edc7bbeda9cbb0d9a26d6b98e086a60a00fce96302fea1c5c9e87696d66c
MD5 4aa147bf4e1040f219c50f44dc404bb1
BLAKE2b-256 11dd1507e56f16318b994a6cb724dcb01408a050337465d093f72a14b22e595d

See more details on using hashes here.

File details

Details for the file directed_inputs_class-202511.2-py3-none-any.whl.

File metadata

  • Download URL: directed_inputs_class-202511.2-py3-none-any.whl
  • Upload date:
  • Size: 6.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.13 {"installer":{"name":"uv","version":"0.9.13"},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for directed_inputs_class-202511.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0f7473959e305d6e52d6ac604a429b6083fc1ec416ba7cd03512b09c4c66226d
MD5 9bba0663b14b28f860389e1caddeca6a
BLAKE2b-256 a1942afd60b6e6cf943ae0fb5d67aa06edba6afb786e01239087ba95d09512f9

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