hal.files package

Submodules

hal.files.parsers module

Parsers for raw databases

class hal.files.parsers.CSVParser(file_path, encoding='utf-8')[source]

Bases: hal.files.parsers.Parser

Parses CSV data files

get_dicts()[source]

Gets dicts in file

Returns:(generator of) of dicts with data from .csv file
get_headers_data()[source]

Gets headers and data

Returns:headers of file
get_matrix()[source]

Stores values in array, store lines in array

Returns:2D matrix
class hal.files.parsers.Parser(file_path)[source]

Bases: object

Mother of all data-files parsers

get_lines()[source]

Gets lines in file

Returns:Lines in file

hal.files.save_as module

Save various data to file

class hal.files.save_as.FileSaver(output_file)[source]

Bases: object

Saves to file

write_dicts_to_csv(dicts)[source]

Saves .csv file with posts data

Parameters:dicts – Dictionaries with same values
write_dicts_to_json(data)[source]

Saves .json file with data

Parameters:data – Data
write_matrix_to_csv(headers, data)[source]

Saves .csv file with data

Parameters:
  • headers – column names
  • data – Data