settings¶
Settings for the Byte portion of the application.
Project Settings.
- pydantic settings src.byte.lib.settings.DiscordSettings[source]¶
Bases:
BaseSettings
Discord Settings.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "DiscordSettings", "description": "Discord Settings.", "type": "object", "properties": { "TOKEN": { "title": "Token", "type": "string" }, "COMMAND_PREFIX": { "default": [ "!" ], "items": { "type": "string" }, "title": "Command Prefix", "type": "array" }, "DEV_GUILD_ID": { "title": "Dev Guild Id", "type": "integer" }, "DEV_USER_ID": { "title": "Dev User Id", "type": "integer" }, "PLUGINS_LOC": { "default": "/home/runner/work/byte/byte/src/byte/plugins", "format": "path", "title": "Plugins Loc", "type": "string" }, "PLUGINS_DIRS": { "default": [ "/home/runner/work/byte/byte/src/byte/plugins" ], "items": { "format": "path", "type": "string" }, "title": "Plugins Dirs", "type": "array" }, "PRESENCE_URL": { "default": "", "title": "Presence Url", "type": "string" } }, "required": [ "TOKEN", "DEV_GUILD_ID", "DEV_USER_ID" ] }
- Config:
extra: str = ignore
case_sensitive: bool = True
env_prefix: str = DISCORD_
env_file: str = .env
- Fields:
- Validators:
- field PLUGINS_LOC: Path = PosixPath('/home/runner/work/byte/byte/src/byte/plugins')¶
Base Path to plugins directory.
- field PLUGINS_DIRS: list[Path] = ['/home/runner/work/byte/byte/src/byte/plugins']¶
Directories to search for plugins.
- validator assemble_command_prefix » COMMAND_PREFIX[source]¶
Assembles the bot command prefix based on the environment.
- Parameters:
value – Default value of
COMMAND_PREFIX
. Currently["!"]
- Returns:
The assembled prefix string.
- validator assemble_presence_url » PRESENCE_URL[source]¶
Assembles the bot presence url based on the environment.
- Parameters:
value – Not used.
- Returns:
The assembled prefix string.
- pydantic settings src.byte.lib.settings.LogSettings[source]¶
Bases:
BaseSettings
Logging config for the Project.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "LogSettings", "description": "Logging config for the Project.", "type": "object", "properties": { "LEVEL": { "default": 20, "title": "Level", "type": "integer" }, "DISCORD_LEVEL": { "default": 30, "title": "Discord Level", "type": "integer" }, "WEBSOCKETS_LEVEL": { "default": 30, "title": "Websockets Level", "type": "integer" }, "ASYNCIO_LEVEL": { "default": 20, "title": "Asyncio Level", "type": "integer" }, "FORMAT": { "default": "[[ %(asctime)s ]] - [[ %(name)s ]] - [[ %(levelname)s ]] - %(message)s", "title": "Format", "type": "string" }, "FILE": { "default": "/home/runner/work/byte/byte/src/logs/byte.log", "format": "path", "title": "File", "type": "string" } } }
- Config:
extra: str = ignore
case_sensitive: bool = True
env_prefix: str = LOG_
env_file: str = .env
- Fields:
- model_computed_fields: ClassVar[dict[str, ComputedFieldInfo]] = {}¶
A dictionary of computed field names and their corresponding ComputedFieldInfo objects.
- field FORMAT: str = '[[ %(asctime)s ]] - [[ %(name)s ]] - [[ %(levelname)s ]] - %(message)s'¶
Log format string.
- field FILE: Path = PosixPath('/home/runner/work/byte/byte/src/logs/byte.log')¶
Log file path.
- pydantic settings src.byte.lib.settings.ProjectSettings[source]¶
Bases:
BaseSettings
Project Settings.
Create a new model by parsing and validating input data from keyword arguments.
Raises [ValidationError][pydantic_core.ValidationError] if the input data cannot be validated to form a valid model.
self is explicitly positional-only to allow self as a field name.
Show JSON schema
{ "title": "ProjectSettings", "description": "Project Settings.", "type": "object", "properties": { "DEBUG": { "default": false, "title": "Debug", "type": "boolean" }, "ENVIRONMENT": { "default": "prod", "title": "Environment", "type": "string" }, "VERSION": { "default": "0.2.0", "title": "Version", "type": "string" } } }
- Config:
extra: str = ignore
case_sensitive: bool = True
env_file: str = .env
- Fields: