Configuration¶
nflreadpy.config.NflreadpyConfig ¶
Bases: BaseSettings
Configuration settings for nflreadpy.
This class manages all configuration options for the nflreadpy package. Settings can be configured via environment variables or programmatically.
Environment Variables
- NFLREADPY_CACHE: Cache mode ("memory", "filesystem", or "off")
- NFLREADPY_CACHE_DIR: Directory path for filesystem cache
- NFLREADPY_CACHE_DURATION: Cache duration in seconds
- NFLREADPY_PREFER: Preferred data format ("parquet" or "csv")
- NFLREADPY_VERBOSE: Enable verbose output (true/false)
- NFLREADPY_TIMEOUT: HTTP request timeout in seconds
- NFLREADPY_USER_AGENT: Custom user agent string
Example
nflreadpy.config.update_config ¶
Update configuration settings programmatically.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
**kwargs
|
Any
|
Configuration options to update. Valid options include: - cache_mode: "memory", "filesystem", or "off" - cache_dir: Path to cache directory (str or Path) - cache_duration: Cache duration in seconds (int) - prefer_format: "parquet" or "csv" - verbose: Enable verbose output (bool) - timeout: HTTP timeout in seconds (int) - user_agent: Custom user agent string (str) |
{}
|
Raises:
Type | Description |
---|---|
ValueError
|
If an unknown configuration option is provided. |
Example
Source code in src/nflreadpy/config.py
nflreadpy.config.get_config ¶
Get the current configuration instance.
Returns:
Type | Description |
---|---|
NflreadpyConfig
|
The global configuration object containing all current settings. |
Example
Source code in src/nflreadpy/config.py
nflreadpy.config.reset_config ¶
Reset all configuration settings to their default values.
This will restore all settings to their initial state, clearing any programmatic or environment variable overrides.