def configfile_from_path(path, strict=True):
    """Get a ConfigFile object based on a file path.

    This method will inspect the file extension and return the appropriate
    ConfigFile subclass initialized with the given path.

    Args:
        path (str): The file path which represents the configuration file.
        strict (bool): Whether or not to parse the file in strict mode.

    Returns:
        confpy.loaders.base.ConfigurationFile: The subclass which is
            specialized for the given file path.

    Raises:
        UnrecognizedFileExtension: If there is no loader for the path.
    """
    extension = path.split('.')[-1]
    conf_type = FILE_TYPES.get(extension)
    if not conf_type:

        raise exc.UnrecognizedFileExtension(
            "Cannot parse file of type {0}. Choices are {1}.".format(
                extension,
                FILE_TYPES.keys(),
            )
        )

    return conf_type(path=path, strict=strict)
Get a ConfigFile object based on a file path.

    This method will inspect the file extension and return the appropriate
    ConfigFile subclass initialized with the given path.

    Args:
        path (str): The file path which represents the configuration file.
        strict (bool): Whether or not to parse the file in strict mode.

    Returns:
        confpy.loaders.base.ConfigurationFile: The subclass which is
            specialized for the given file path.

    Raises:
        UnrecognizedFileExtension: If there is no loader for the path.