Models and Validation API¶
Model lists support application defaults and validation. throw_if is the shared required-value
guard used by provider modules.
config
¶
Assembly: minions Filename: config.py Author: Terry D. Eppler Created: 09-03-2026
Last Modified By: Terry D. Eppler Last Modified On: 09-06-2026
config.py
Copyright © 2026 Terry D. Eppler
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the “Software”), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
THE SOFTWARE IS PROVIDED “AS IS”, WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
You can contact me at: terryeppler@gmail.com or eppler.terry@epa.gov
get_bool(name: str, default: bool = False) -> bool
¶
Read a Boolean environment variable.
Purpose
Parses a recognized Boolean representation. An absent variable returns the supplied default; an unrecognized defined value is rejected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Nonblank environment variable name. |
required |
default
|
bool
|
Default value when the variable is absent; defaults to False. |
False
|
Returns:
| Name | Type | Description |
|---|---|---|
bool |
bool
|
Parsed Boolean value or the supplied default. |
Raises:
| Type | Description |
|---|---|
Error
|
If the argument or defined environment value is invalid. |
Source code in config.py
get_int(name: str, default: int) -> int
¶
Read an integer environment variable.
Purpose
Converts environment text into an integer. An absent or empty variable returns the supplied default; malformed nonempty values are rejected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Nonblank environment variable name. |
required |
default
|
int
|
Integer default, excluding Boolean values. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
int |
int
|
Parsed integer value or the supplied default. |
Raises:
| Type | Description |
|---|---|
Error
|
If an argument or defined environment value is invalid. |
Source code in config.py
get_float(name: str, default: float) -> float
¶
Read a floating-point environment variable.
Purpose
Converts environment text into a floating-point number. An absent or empty variable returns the supplied default; malformed nonempty values are rejected.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Nonblank environment variable name. |
required |
default
|
float
|
Numeric default; integers are accepted, but Booleans are not. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
float |
float
|
Parsed floating-point value or the supplied numeric default. |
Raises:
| Type | Description |
|---|---|
Error
|
If an argument or defined environment value is invalid. |
Source code in config.py
get_path(name: str, default: Path) -> Path
¶
Read a path environment variable.
Purpose
Resolves the supplied environment path, or the default path when the variable is absent or empty. Invalid arguments and path resolution failures are propagated.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Nonblank environment variable name. |
required |
default
|
Path
|
Default filesystem path. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
Path |
Path
|
Resolved environment path or resolved default path. |
Raises:
| Type | Description |
|---|---|
Error
|
If an argument or path resolution is invalid. |
Source code in config.py
get_text(name: str, default: str) -> str
¶
Read a text environment variable.
Purpose
Returns the environment value unchanged. An absent or empty variable returns the supplied default, which may itself be an empty string.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
Nonblank environment variable name. |
required |
default
|
str
|
Default text; an empty string is valid. |
required |
Returns:
| Name | Type | Description |
|---|---|---|
str |
str
|
Environment value or supplied default. |
Raises:
| Type | Description |
|---|---|
Error
|
If an argument is invalid. |
Source code in config.py
Required-value guard¶
Provider modules use throw_if from minions.__init__ to reject None, empty strings, and empty
collections before an SDK call. It is an internal consistency helper rather than part of the
workflow-facing API.