semvec/pypi-packages huggingface dataset:
get-settings-yaml 1.0.0
Find and load settings.yaml data into your project
Keywords: settings,yaml

# get-settings-yaml

Small module for finding and parsing settings.yaml file in your project.

## Setup

```shell
python -m pip install get-settings-yaml

```

## API

Assuming the project structure:

- myproject/
  - src/
    - run.py
- my_settings.yaml

If you want to load `my_settings.yaml` from `run.py` script you should use this code inside:

```python
import os
from get_settings_yaml import parse_settings


CURRENT_WORKING_DIR = os.path.dirname(__file__)
SETTINGS_FNAME = 'my_settings.yaml'
SETTINGS = parse_settings(base_path=CURRENT_WORKING_DIR, settings_filename=SETTINGS_FNAME)

if __name__ == '__main__':
    # Do something and use parsed settings
    pass

```

If you want to check path to the settings file:

```python
import os
from get_settings_yaml import load_path


CURRENT_WORKING_DIR = os.path.dirname(__file__)
SETTINGS_FNAME = 'my_settings.yaml'
SETTINGS_PATH = load_path(base_path=CURRENT_WORKING_DIR, settings_filename=SETTINGS_FNAME)

if __name__ == '__main__':
    # Do something and load settings later
    pass

```