Skip to content

Commit

Permalink
docs(dotenv): add configuration class for environment variables in HyFI
Browse files Browse the repository at this point in the history
  • Loading branch information
entelecheia committed Jul 4, 2023
1 parent dfcf3ac commit f5493ba
Show file tree
Hide file tree
Showing 2 changed files with 47 additions and 0 deletions.
3 changes: 3 additions & 0 deletions docs/reference/dotenv/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# `hyfi.dotenv`

::: hyfi.dotenv
44 changes: 44 additions & 0 deletions src/hyfi/dotenv/__init__.py
Original file line number Diff line number Diff line change
@@ -1,3 +1,6 @@
"""
Configuration class for environment variables in HyFI.
"""
import os
from typing import Optional, Tuple, Type, Union

Expand All @@ -15,6 +18,46 @@


class DotEnvConfig(BaseSettings):
"""
Configuration class for environment variables in HyFI.
Attributes:
_config_name_: str: Name of the configuration.
DOTENV_FILENAME: Optional[str]: Name of the dotenv file.
DOTENV_DIR: Optional[str]: Path to the dotenv file.
DOTENV_PATH: Optional[str]: Full path to the dotenv file.
HYFI_RESOURCE_DIR: Optional[str]: Path to the resource directory.
HYFI_GLOBAL_ROOT: Optional[str]: Path to the global root directory.
HYFI_GLOBAL_WORKSPACE_NAME: Optional[str]: Name of the global workspace.
HYFI_PROJECT_NAME: Optional[str]: Name of the project.
HYFI_PROJECT_DESC: Optional[str]: Description of the project.
HYFI_PROJECT_ROOT: Optional[str]: Path to the project root directory.
HYFI_PROJECT_WORKSPACE_NAME: Optional[str]: Name of the project workspace.
HYFI_LOG_LEVEL: Optional[str]: Log level for HyFI.
HYFI_VERBOSE: Optional[Union[bool, str, int]]: Verbosity level for HyFI.
HYFI_NUM_WORKERS: Optional[int]: Number of workers for HyFI.
CACHED_PATH_CACHE_ROOT: Optional[str]: Path to the cached path cache root.
CUDA_DEVICE_ORDER: Optional[str]: CUDA device order.
CUDA_VISIBLE_DEVICES: Optional[str]: CUDA visible devices.
WANDB_PROJECT: Optional[str]: Name of the Weights & Biases project.
WANDB_DISABLED: Optional[str]: Whether Weights & Biases is disabled.
WANDB_DIR: Optional[str]: Path to the Weights & Biases directory.
WANDB_NOTEBOOK_NAME: Optional[str]: Name of the Weights & Biases notebook.
WANDB_SILENT: Optional[Union[bool, str]]: Whether Weights & Biases is silent.
LABEL_STUDIO_SERVER: Optional[str]: URL of the Label Studio server.
KMP_DUPLICATE_LIB_OK: Optional[str]: Whether to allow duplicate libraries for Intel MKL.
TOKENIZERS_PARALLELISM: Optional[Union[bool, str]]: Whether tokenizers are parallelized.
WANDB_API_KEY: Optional[SecretStr]: Weights & Biases API key.
HUGGING_FACE_HUB_TOKEN: Optional[SecretStr]: Hugging Face Hub token.
OPENAI_API_KEY: Optional[SecretStr]: OpenAI API key.
ECOS_API_KEY: Optional[SecretStr]: ECOS API key.
FRED_API_KEY: Optional[SecretStr]: FRED API key.
NASDAQ_API_KEY: Optional[SecretStr]: NASDAQ API key.
HF_USER_ACCESS_TOKEN: Optional[SecretStr]: Hugging Face user access token.
LABEL_STUDIO_USER_TOKEN: Optional[SecretStr]: Label Studio user token.
model_config: SettingsConfigDict: Configuration dictionary for the model.
"""

"""Environment variables for HyFI"""

_config_name_: str = "__init__"
Expand Down Expand Up @@ -87,4 +130,5 @@ def check_and_set_values(cls, m: "DotEnvConfig"):

@property
def os(self):
"""Returns the OS environment variables."""
return os.environ

0 comments on commit f5493ba

Please sign in to comment.