Skip to content

FileConfig

Bases: ConfigObject

Base for root configuration objects loaded from JSON files. Is based on ConfigObject, so both loading from file and from a mapping are supported.

from_dict(data) classmethod

Create a config object from dict (or any other dict-compatible mapping).

Parameters:

Name Type Description Default
data Mapping[str, Any]

The data mapping to create a config object from.

required

Returns:

Name Type Description
ConfigObject Self

The config object created from data mapping.

from_file(path) classmethod

Create a config object from a valid JSON file.

Parameters:

Name Type Description Default
path Path | str

Path to a valid JSON file to read the data from.

required

Returns:

Name Type Description
FileConfig Self

The config object created from data mapping.