Directed inputs class consumes and processes inputs from sources beyond args and kwargs
Project description
Directed Inputs Class
🛠️ Manage your Python inputs efficiently! 🎯
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
- Get Help (use the directed-inputs-class tag on Stack Overflow)
- PyPI
- GitHub
- Documentation
- Changelog
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file directed_inputs_class-202511.5.0.tar.gz.
File metadata
- Download URL: directed_inputs_class-202511.5.0.tar.gz
- Upload date:
- Size: 10.8 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
85ac7821b25bf49154f99543a160da2d2b0f6e5b37ed71db15e5f96f94f1e9c7
|
|
| MD5 |
19a06f8d0412308d4decf001b68eaff7
|
|
| BLAKE2b-256 |
6fe401a40139d3fc2d39ab2608d1bd1b4d44e523d5b3c3dca69cfd850b99a242
|
File details
Details for the file directed_inputs_class-202511.5.0-py3-none-any.whl.
File metadata
- Download URL: directed_inputs_class-202511.5.0-py3-none-any.whl
- Upload date:
- Size: 6.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
51198073ed2da1f2ba9d24b0491d6e8a29911b9c4fe091219e92e8cd3946ffc8
|
|
| MD5 |
940faaed45aa16208c4736e1f9ab1ade
|
|
| BLAKE2b-256 |
5eff9a7464c82c5c23788de9de43d330dfa2e25a065ecd76060c6d0419f6f756
|