idmtools.utils.file_parser module¶
File parser utility. Used to automatically load data.
Copyright 2021, Bill & Melinda Gates Foundation. All rights reserved.
- class idmtools.utils.file_parser.FileParser[source]¶
Bases:
object
FileParser to load contents in analysis.
- classmethod parse(filename, content=None)[source]¶
Parse filename and load the content.
- Parameters:
filename – Filename to load
content – Content to load
- Returns:
Content loaded
- classmethod load_json_file(filename, content) Dict [source]¶
Load JSON File.
- Parameters:
filename – Filename to load
content – Content
- Returns:
JSOn as dict
- classmethod load_raw_file(filename, content)[source]¶
Load content raw.
- Parameters:
filename – Filename is none
content – Content to load
- Returns:
Content as it was
- classmethod load_csv_file(filename, content) DataFrame [source]¶
Load csv file.
- Parameters:
filename – Filename to load
content – Content is loading
- Returns:
Loaded csv file
- classmethod load_xlsx_file(filename, content) Dict[str, ExcelFile] [source]¶
Load excel_file.
- Parameters:
filename – Filename to load
content – Content to load
- Returns:
Loaded excel file