pyconfs/formats/__init__.py
def guess_format(file_path: Union[str, pathlib.Path]) -> str:
    """Guess the format of a file based on the file suffix"""
    if not FORMATS:
        _read_formats()

    file_path = pathlib.Path(file_path)
    suffix = file_path.suffix
    for format, suffixes in FORMATS.items():
        if suffix in suffixes:
            return format

    raise UnknownFormat(f"Could not guess format of {file_path}")
Guess the format of a file based on the file suffix
Guess the format of a file based on the file suffix
Guess the format of a file based on the file suffix
def guess_format(file_path: Union[str, pathlib.Path]) -> str:
    if not FORMATS:
        _read_formats()
    file_path = pathlib.Path(file_path)
    suffix = file_path.suffix
    for format, suffixes in FORMATS.items():
        if suffix in suffixes:
            return format
    raise UnknownFormat(f"Could not guess format of {file_path}")
def guess_format ( file_path : Union [ str , pathlib . Path ] ) -> str : if not FORMATS : _read_formats ( ) file_path = pathlib . Path ( file_path ) suffix = file_path . suffix for format , suffixes in FORMATS . items ( ) : if suffix in suffixes : return format raise UnknownFormat ( f"Could not guess format of {file_path}" )
Guess the format of a file based on the file suffix
Guess the format of a file based on the file suffix
"""Guess the format of a file based on the file suffix"""
file_path
Union[str, pathlib.Path]