trading_agent.configuration.configuration_loader
¶
Reads trading_agent.toml into an AgentConfiguration.
Typical usage example:
loader = ConfigurationLoader(Path('trading_agent.toml')) configuration = loader.load()
ConfigurationError
¶
Bases: ValueError
The configuration file is missing, unreadable or invalid.
ConfigurationLoader
¶
Reads and checks one configuration file.
Attributes:
| Name | Type | Description |
|---|---|---|
configuration_path |
The TOML file to read. |
Remembers which file to read, without reading it yet.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
configuration_path
|
Path
|
The TOML file to read. |
required |
Source code in src/trading_agent/configuration/configuration_loader.py
load
¶
Reads the file and checks every value in it.
Returns:
| Type | Description |
|---|---|
AgentConfiguration
|
The checked configuration. |
Raises:
| Type | Description |
|---|---|
ConfigurationError
|
The file is missing, is not valid TOML, or holds a value of the wrong kind. |