env

Environment variable helpers.

This module provides small, centralized parsing helpers for environment variables.

exception pipecat.utils.env.InvalidEnvVarValueError(name: str, value: str, expected: str)[source]

Bases: ValueError

Raised when an environment variable value cannot be parsed.

__init__(name: str, value: str, expected: str)[source]

Initialize an InvalidEnvVarValueError.

pipecat.utils.env.env_truthy(name: str, default: bool = False) bool[source]

Interpret an environment variable as a boolean.

  • If the variable is not set, returns default.

  • If the variable is set to a recognized boolean string, returns the parsed value.

  • Otherwise, raises InvalidEnvVarValueError.

Recognized values (case-insensitive, whitespace ignored): - Truthy: “1”, “true”, “yes”, “y”, “on” - Falsy: “0”, “false”, “no”, “n”, “off”, “”