MCPcopy
hub / github.com/ranaroussi/quantstats / _html_table

Function _html_table

quantstats/reports.py:1559–1570  ·  view source on GitHub ↗
(obj, showindex="default")

Source from the content-addressed store, hash-verified

1557
1558
1559def _html_table(obj, showindex="default"):
1560 obj = _tabulate(
1561 obj, headers="keys", tablefmt="html", floatfmt=".2f", showindex=showindex
1562 )
1563 obj = obj.replace(' style="text-align: right;"', "")
1564 obj = obj.replace(' style="text-align: left;"', "")
1565 obj = obj.replace(' style="text-align: center;"', "")
1566 obj = _regex.sub("<td> +", "<td>", obj)
1567 obj = _regex.sub(" +</td>", "</td>", obj)
1568 obj = _regex.sub("<th> +", "<th>", obj)
1569 obj = _regex.sub(" +</th>", "</th>", obj)
1570 return obj
1571
1572
1573def _download_html(html, filename="quantstats-tearsheet.html"):

Callers 1

htmlFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected