(
    schema_path, *, named_schemas=None, _write_hint=True, _injected_schemas=None
)
return _load_schema(
        schema, schema_dir, named_schemas, _write_hint, _injected_schemas
    )
Returns a schema loaded from the file at `schema_path`.

    Will recursively load referenced schemas assuming they can be found in
    files in the same directory and named with the convention
    `<full_name>.avsc`.

    Parameters
    ----------
    schema: str
        Path to schema file to load
    named_schemas: dict
        Dictionary of named schemas to their schema definition
    _write_hint: bool
        Internal API argument specifying whether or not the __fastavro_parsed
        marker should be added to the schema
    _injected_schemas: set
        Internal API argument. Set of names that have been injected


    Consider the following example...


    Parent.avsc::

        {
            "type": "record",
            "name": "Parent",
            "namespace": "namespace",
            "fields": [
                {
                    "name": "child",
                    "type": "Child"
                }
            ]
        }


    namespace.Child.avsc::

        {
            "type": "record",
            "namespace": "namespace",
            "name": "Child",
            "fields": []
        }


    Code::

        from fastavro.schema import load_schema

        parsed_schema = load_schema("Parent.avsc")
Returns a schema loaded from the file at `schema_path`.
Returns a schema loaded from the file at schema_path .
def load_schema(
    schema_path, *, named_schemas=None, _write_hint=True, _injected_schemas=None
):
    """Returns a schema loaded from the file at `schema_path`.

    Will recursively load referenced schemas assuming they can be found in
    files in the same directory and named with the convention
    `<full_name>.avsc`.

    Parameters
    ----------
    schema: str
        Path to schema file to load
    named_schemas: dict
        Dictionary of named schemas to their schema definition
    _write_hint: bool
        Internal API argument specifying whether or not the __fastavro_parsed
        marker should be added to the schema
    _injected_schemas: set
        Internal API argument. Set of names that have been injected


    Consider the following example...


    Parent.avsc::

        {
            "type": "record",
            "name": "Parent",
            "namespace": "namespace",
            "fields": [
                {
                    "name": "child",
                    "type": "Child"
                }
            ]
        }


    namespace.Child.avsc::

        {
            "type": "record",
            "namespace": "namespace",
            "name": "Child",
            "fields": []
        }


    Code::

        from fastavro.schema import load_schema

        parsed_schema = load_schema("Parent.avsc")
    """
    if named_schemas is None:
        named_schemas = {}

    if _injected_schemas is None:
        _injected_schemas = set()

    with open(schema_path) as fd:
        schema = json.load(fd)
    schema_dir, schema_file = path.split(schema_path)
    return _load_schema(
        schema, schema_dir, named_schemas, _write_hint, _injected_schemas
    )
def load_schema ( schema_path , * , named_schemas = None , _write_hint = True , _injected_schemas = None ) : if named_schemas is None : named_schemas = { } if _injected_schemas is None : _injected_schemas = set ( ) with open ( schema_path ) as fd : schema = json . load ( fd ) schema_dir , schema_file = path . split ( schema_path ) return _load_schema ( schema , schema_dir , named_schemas , _write_hint , _injected_schemas )