Skip to content

Config

πŸ€– AI-Generated Content

This documentation was generated with AI assistance and is still being audited. Some, or potentially a lot, of this information may be inaccurate. Learn more.

provide.foundation.streams.config

Classes

StreamConfig

Bases: RuntimeConfig

Configuration for console stream output behavior.

Functions
supports_color
supports_color() -> bool

Determine if the console supports color output.

Returns:

Type Description
bool

True if color is supported, False otherwise

Source code in provide/foundation/streams/config.py
def supports_color(self) -> bool:
    """Determine if the console supports color output.

    Returns:
        True if color is supported, False otherwise

    """
    if self.no_color:
        return False

    if self.force_color:
        return True

    # Additional logic for TTY detection would go here
    # For now, just return based on the flags
    return not self.no_color

Functions

get_stream_config

get_stream_config() -> StreamConfig

Get the global stream configuration instance.

Returns:

Type Description
StreamConfig

StreamConfig instance loaded from environment

Source code in provide/foundation/streams/config.py
def get_stream_config() -> StreamConfig:
    """Get the global stream configuration instance.

    Returns:
        StreamConfig instance loaded from environment

    """
    global _stream_config
    if _stream_config is None:
        _stream_config = StreamConfig.from_env()
    return _stream_config

reset_stream_config

reset_stream_config() -> None

Reset the global stream configuration (mainly for testing).

Source code in provide/foundation/streams/config.py
def reset_stream_config() -> None:
    """Reset the global stream configuration (mainly for testing)."""
    global _stream_config
    _stream_config = None