eppy.results package¶
Submodules¶
eppy.results.fasthtml module¶
functions to do a fast read from the E+ HTML table file
- eppy.results.fasthtml.get_upto_nexttable(fhandle)[source]¶
get all lines from the present location in fhandle to the end of the next table
This function is used by tablebyindex to find the title for the table, which is in the lines before the table. Then it can return the title and the table
- Parameters:
fhandle (file like object) – A file handle to the E+ HTML table file
- Returns:
lines_and_table – The table in HTML format with lines before it.
- Return type:
str
- eppy.results.fasthtml.getnexttable(fhandle)[source]¶
get the next table in the html file
Continues to read the file line by line and collects lines from the start of the next table until the end of the table
- Parameters:
fhandle (file like object) – A file handle to the E+ HTML table file
- Returns:
table – The table in HTML format
- Return type:
str
- eppy.results.fasthtml.tablebyindex(filehandle, index)[source]¶
fast extraction of the table using the index to identify the table
This function reads only one table from the HTML file. This is in contrast to results.readhtml.titletable that will read all the tables into memory and allows you to interactively look thru them. The function results.readhtml.titletable can be very slow on large HTML files.
This function is useful when you know which file you are looking for. It does not work with negative indices, like you can in a list. If you know a way to make negative indices work, do a pull request :-)
- Parameters:
fhandle (file like object) – A file handle to the E+ HTML table file
index (int) – This is the index of the table you are looking for
- Returns:
titleandtable –
- (title, table)
title = previous item with a <b> tag
table = rows -> [[cell1, cell2, ..], [cell1, cell2, ..], ..]
- Return type:
(str, list)
- eppy.results.fasthtml.tablebyname(filehandle, header)[source]¶
fast extraction of the table using the header to identify the table
This function reads only one table from the HTML file. This is in contrast to results.readhtml.titletable that will read all the tables into memory and allows you to interactively look thru them. The function results.readhtml.titletable can be very slow on large HTML files.
This function is useful when you know which file you are looking for. It looks for the title line that is in bold just before the table. Some tables don’t have such a title in bold. This function will not work for tables that don’t have a title in bold
- Parameters:
fhandle (file like object) – A file handle to the E+ HTML table file
header (str) – This is the title of the table you are looking for
- Returns:
titleandtable –
- (title, table)
title = previous item with a <b> tag
table = rows -> [[cell1, cell2, ..], [cell1, cell2, ..], ..]
- Return type:
(str, list)
eppy.results.readhtml module¶
read the html outputs
- eppy.results.readhtml.cell2txt(td)[source]¶
clean up the td and return text in it It will ignore any tags within the td
- eppy.results.readhtml.is_simpletable(table)[source]¶
test if the table has only strings in the cells
- eppy.results.readhtml.lines_table(html_doc, tofloat=True)[source]¶
return a list of [(lines, table), …..]
lines = all the significant lines before the table. These are lines between this table and the previous table or ‘hr’ tag
table = rows -> [[cell1, cell2, ..], [cell1, cell2, ..], ..]
The lines act as a description for what is in the table
- eppy.results.readhtml.table2val_matrix(table)[source]¶
convert a table to a list of lists - a 2D matrix Converts numbers to float
- eppy.results.readhtml.table_withcelltag_2matrix(table)[source]¶
convert a table to a list of lists - a 2D matrix but ignores tags within a cell
- eppy.results.readhtml.table_withcelltag_2val_matrix(table)[source]¶
convert a table to a list of lists - a 2D matrix Converts numbers to float but ignores tags within a cell
Module contents¶
version number