load.utils

emtellipro.load.utils

These are utility functions helpful for loading files.

Module Contents

Functions

NameDescription
detect_encodingDetect the encoding of a file.

API

emtellipro.load.utils.detect_encoding

emtellipro.load.utils.detect_encoding(path: typing.Union[str, pathlib.Path]) -> str

Detect the encoding of a file.

If it’s possible to decode the file using ‘utf-8’, then that’s assumed to be correct; otherwise chardet will be used to detect the most likely encoding.

Parameters:

path
typing.Union[str, pathlib.Path]

The path to a file.

Return type: str