Config & CLI¶
config ¶
LogLevelFilter ¶
Bases: Filter
Initializes the filter with specific logging levels.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
levels
|
List[int]
|
A list of logging level values (integers) to include. |
required |
Source code in src/bbstrader/config.py
filter ¶
Filters log records based on their level.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
record
|
LogRecord
|
The log record to check. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True if the record's level is in the allowed levels, False otherwise. |
Source code in src/bbstrader/config.py
get_config_dir ¶
Get the path to the configuration directory.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
name
|
str
|
The name of the configuration directory. |
'.bbstrader'
|
Returns:
| Type | Description |
|---|---|
Path
|
The path to the configuration directory. |
Source code in src/bbstrader/config.py
scripts ¶
load_module ¶
Load a module from a file path. Args: file_path: Path to the file to load. Returns: The loaded module.
Source code in src/bbstrader/scripts.py
load_class ¶
Load a class from a module. Args: module: The module to load the class from. class_name: The name of the class to load. base_class: The base class that the class must inherit from.
Source code in src/bbstrader/scripts.py
summarize_text ¶
Generate a summary using TextRank algorithm.
Source code in src/bbstrader/scripts.py
compat ¶
setup_mock_modules ¶
Mock some modules not available on some OS to prevent import errors.