fabricatio_tool.fs.readers

Filesystem readers for Fabricatio.

Functions

safe_text_read(→ str)

Safely read the text from a file.

safe_json_read(→ Dict)

Safely read the JSON from a file.

Module Contents

fabricatio_tool.fs.readers.safe_text_read(path: pathlib.Path | str) str

Safely read the text from a file.

Parameters:

path (Path|str) – The path to the file.

Returns:

The text from the file.

Return type:

str

fabricatio_tool.fs.readers.safe_json_read(path: pathlib.Path | str) Dict

Safely read the JSON from a file.

Parameters:

path (Path|str) – The path to the file.

Returns:

The JSON from the file.

Return type:

dict