Usage ===== Creation -------- The easiest way of using ``schema_config`` is to just load the schema from a string: .. code-block:: python from schema_config import Configurator schema = """ { "type": "object", "properties": { "port": { "type": "number" } }, required: ["port"] } """ config_gen = Configurator.from_string(schema) Or combined with ``resource_string()``: .. code-block:: python from pkg_resources import resource_string from schema_config import Configurator schema = resource_string(__name__, "config.schema.json") config_gen = Configurator.from_string(schema) Or you can load the schema from a file: .. code-block:: python from schema_config import Configurator config_gen = Configurator.from_file("./config.schema.json") The last option is to feed it a ``dict`` directly: .. code-block:: python from schema_config import Configurator schema = { "type": "object", "properties": { "port": { "type": "number" } }, required: ["port"] } config_gen = Configurator(schema) Plugins ------- Plugins can be added like this: .. code-block:: python from schema_config import EnvPlugin config_gen.add_plugin(EnvPlugin()) Config ------ Finally you can load the config like that: .. code-block:: python config = config_gen.load_config() Read about :ref:`plugin_page` or the :ref:`Configuration`