Skip to main content

config

Base configuration class for shared utilities.

Common configuration fields used by both text-extractor and docling-extractor services.

Classes

BaseConfig

Base configuration class with common fields for all extraction services.

Methods

validate_kafka_brokers

def validate_kafka_brokers(cls, v: str) -> str

Validate Kafka broker format: host:port,host:port

validate_db_port

def validate_db_port(cls, v: int) -> int

Validate database port range.

validate_endpoint_url

def validate_endpoint_url(cls, v: str) -> str

Validate endpoint URL format.

generate_bucket_name

def generate_bucket_name(self, organization_id: str) -> str

Generate Spaces bucket name for an organization.

In test environments (PYTHON_ENV=test), automatically uses 'coda-test-org-' prefix to distinguish test buckets from production buckets.

Args: organization_id: Organization UUID

Returns: Bucket name: {spaces_bucket_prefix}{organization_id}

Functions

load_env

def load_env() -> None

Load environment variables from .env file.

In containerized development, the .env file is located in the repository root. In production, environment variables are provided by the orchestrator.