swxsoc_reach.io.file_tools#

Provides generic file readers.

Functions

read_file(file_path)

Reads a file and returns a pandas DataFrame.

read_udl_json(file_path)

Reads a UDL JSON file and returns a pandas DataFrame.

read_udl_csv(file_path)

Reads a UDL CSV file and returns a pandas DataFrame.

swxsoc_reach.io.file_tools.read_file(file_path: Path) DataFrame[source]#

Reads a file and returns a pandas DataFrame.

Parameters:

file_path (Path) – The path to the file to read.

Returns:

pd.DataFrame – A DataFrame containing the data from the file.

swxsoc_reach.io.file_tools.read_udl_csv(file_path: Path) DataFrame[source]#

Reads a UDL CSV file and returns a pandas DataFrame. Unpacks nested JSON structures in the CSV into a flat DataFrame.

Parameters:

file_path (Path) – The path to the UDL CSV file.

Returns:

pd.DataFrame – A DataFrame containing the data from the UDL CSV file.

swxsoc_reach.io.file_tools.read_udl_json(file_path: Path) DataFrame[source]#

Reads a UDL JSON file and returns a pandas DataFrame. Unpacks nested JSON structures into a flat DataFrame.

Parameters:

file_path (Path) – The path to the UDL JSON file.

Returns:

pd.DataFrame – A DataFrame containing the data from the UDL JSON file.