fastcfg package
Subpackages
- fastcfg.backoff package
- fastcfg.cache package
- fastcfg.config package
- Submodules
- fastcfg.config.attributes module
ConfigAttributes
ConfigAttributes.__attributes
ConfigAttributes.__init__()
ConfigAttributes.get_attribute()
ConfigAttributes.get_attributes()
ConfigAttributes._convert_value_to_item()
ConfigAttributes._add_attribute()
ConfigAttributes.add_or_update_attribute()
ConfigAttributes.add_or_update_attribute()
ConfigAttributes.get_attribute()
ConfigAttributes.get_attributes()
ConfigAttributes.has_attribute()
ConfigAttributes.remove_attribute()
- fastcfg.config.interface module
ConfigInterface
ConfigInterface._config_attributes
ConfigInterface._current_env
ConfigInterface.__init__()
ConfigInterface.set_environment()
ConfigInterface.get_environment()
ConfigInterface.to_dict()
ConfigInterface.value()
ConfigInterface.environment
ConfigInterface.environments
ConfigInterface.export_values()
ConfigInterface.get()
ConfigInterface.import_values()
ConfigInterface.items()
ConfigInterface.keys()
ConfigInterface.load()
ConfigInterface.pop()
ConfigInterface.remove_environment()
ConfigInterface.save()
ConfigInterface.set_environment()
ConfigInterface.set_parent()
ConfigInterface.to_dict()
ConfigInterface.update()
ConfigInterface.value
ConfigInterface.values()
- fastcfg.config.items module
- fastcfg.config.state module
- fastcfg.config.utils module
- fastcfg.config.value_wrapper module
- Module contents
- fastcfg.default package
- fastcfg.sources package
- fastcfg.validation package
Submodules
fastcfg.exceptions module
- exception fastcfg.exceptions.ConfigItemValidationError(message: str)[source]
Bases:
Exception
Exception raised when a config item value fails validation.
- exception fastcfg.exceptions.FileReadError[source]
Bases:
Exception
Exception raised when a file cannot be read.
- exception fastcfg.exceptions.InvalidOperationError(message: str = 'Invalid operation performed.')[source]
Bases:
Exception
Exception raised when an invalid operation is performed.
- exception fastcfg.exceptions.MaxRetriesExceededError(backoff_policy, total_time_slept: float)[source]
Bases:
Exception
Exception raised when the maximum number of retries is exceeded in exponential backoff.
- exception fastcfg.exceptions.MissingCacheKeyError(key)[source]
Bases:
Exception
Exception raised when a cache key doesn’t exist.
- exception fastcfg.exceptions.MissingConfigKeyError(key)[source]
Bases:
Exception
Exception raised when a config key doesn’t exist.
- exception fastcfg.exceptions.MissingDependencyError(dependency: str)[source]
Bases:
Exception
Exception raised when a dependency is missing.
Module contents
FastCFG - Modern configuration management for Python applications.
Created by Josh Breidinger (2025) Author: Josh Breidinger Email: company@breisoft.com GitHub: https://github.com/breisoft
Born from the frustration of serverless configuration hell, FastCFG makes config management simple, fast, and reliable.
- fastcfg.needs_value(func: Callable[[...], Any], config_value: Any, *args: Any, verbose: bool = False, **kwargs: Any) bool | None [source]
Test whether a function requires explicit .value access or works with FastCFG magic.
This helper function determines if you can pass a FastCFG config value directly to a function, or if you need to use .value to extract the underlying value. This is particularly useful for identifying C extensions that require exact types.
- Parameters:
func – The function to test compatibility with
config_value – A FastCFG wrapped value (e.g., config.port)
*args – Additional positional arguments to pass to func (after config_value)
verbose – If True, prints diagnostic information about the test
**kwargs – Keyword arguments to pass to func
- Returns:
False: Function works with FastCFG magic (no .value needed)
True: Function requires .value to be called on config_value
None: Function doesn’t work even with .value (incompatible)
- Return type:
bool or None
Example
config.size = 10
# Check if np.zeros needs .value if needs_value(np.zeros, config.size):
arr = np.zeros(config.size.value)
- else:
arr = np.zeros(config.size)
# With verbose output for debugging needs_value(np.zeros, config.size, verbose=True) # Prints: zeros requires .value - use config.size.value
- fastcfg.refresh(target: Config | AbstractConfigItem)[source]
Manually refresh a Config or ConfigItem to detect external changes.
- Parameters:
target – Config object or ConfigItem to refresh
Example
# In your own loop for _ in range(60):
refresh(config.my_var) # Triggers change detection time.sleep(1)