# AUTOGENERATED! DO NOT EDIT! File to edit: ../nbs/api/inout.ipynb.

# %% auto 0
__all__ = ['write_toml', 'read_toml']

# %% ../nbs/api/inout.ipynb 2
import tomli_w
import tomli

# %% ../nbs/api/inout.ipynb 3
def write_toml(fname, cfg):
    print(f'Creating {fname}')
    with open(fname, "wb") as f:
        tomli_w.dump(cfg, f)

# %% ../nbs/api/inout.ipynb 4
def read_toml(fname):
    with open(fname, "rb") as f:
        config = tomli.load(f)
    return config
