Usage

From string

from r_config import RConfig

rc = RConfig()

str_yaml = """
    example1:
      id: 2
      name: 'Ramin'
    # comment to test
    example2:
      sub1:
        p1: 2.2
      sub2: 'test_1'
 """

rc.update_from_str(str_yaml)

From file

from r_config import RConfig
from pathlib import Path

rc = RConfig()

path = Path('/path/to/config.yaml')

rc.update_from_file(path)

From dict

from r_config import RConfig

r_dict = {'a': 10, 'b': 'salam', 'f': {'p': 2, 'q': 3}}

rc = RConfig(r_dict)