Metadata-Version: 2.1
Name: get-settings-yaml
Version: 1.0.0
Summary: Find and load settings.yaml data into your project
Author-email: Szymon Moliński <simon@dataverselabs.com>
Maintainer: Szymon Moliński
Keywords: settings,yaml
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 3.8
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Intended Audience :: Developers
Classifier: Topic :: Software Development
Classifier: Topic :: Utilities
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: pyyaml==6.0.1

# 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

```
