fromnbconvert_a11y.tablesimportget_table,Configfromnbconvert_a11y.axeimportasync_axe(df:=pandas.concat(dict(zip("ab",([DataFrame(numpy.random.randn(50,3)),DataFrame(numpy.random.randn(50,3))]))),axis=1))df=df.set_index(df.index)(table:=get_table(df,Config(group_columns=True,group_index=True),caption="randomly generated data we can test."))
validator=DataFrame(awaitasync_axe.validate_html(str(table))).messages.series()validator.groupby("message").count()[["type"]].pipe(get_table,caption="caption a summary of the vnu validator errors for the dataframe we generated.")
caption a summary of the vnu validator errors for the dataframe we generated.
message
type
Attribute “aria-colspan” is unnecessary for elements that have attribute “colspan”.
8
Attribute “aria-rowspan” is unnecessary for elements that have attribute “rowspan”.
2
Bad value “True” for attribute “aria-hidden” on element “span”.
1
Bad value “colheader” for attribute “role” on element “th”.
38
Bad value “rowheader” for attribute “role” on element “th”.
2
Consider adding a “lang” attribute to the “html” start tag to declare the language of this document.
1
Element “head” is missing a required instance of child element “title”.
1
Element “td” is missing one or more of the following attributes: “role”.
1
Start tag seen without seeing a doctype first. Expected “<!DOCTYPE html>”.
1
Table cell spans past the end of its row group established by a “tbody” element; clipped to the end of the row group.
2
The “cell” role is unnecessary for element “td”.
132
The “role” attribute must not be used on a “td” element which has a “table” ancestor with no “role” attribute, or with a “role” attribute whose value is “table”, “grid”, or “treegrid”.
132
The “role” attribute must not be used on a “th” element which has a “table” ancestor with no “role” attribute, or with a “role” attribute whose value is “table”, “grid”, or “treegrid”.
40
The “role” attribute must not be used on a “tr” element which has a “table” ancestor with no “role” attribute, or with a “role” attribute whose value is “table”, “grid”, or “treegrid”.
27
The “rowgroup” role is unnecessary for element “tbody”.
3
The “rowgroup” role is unnecessary for element “tfoot”.
1
The “rowgroup” role is unnecessary for element “thead”.
1
The “rowheader” role is unnecessary for element “th”.
2
The “row” role is unnecessary for element “tr”.
27
The “table” role is unnecessary for element “table”.
Series((awaitasync_axe.validate_axe(str(table))).get("violations")).series().set_index("id").groupby("impact").pipe(get_table,caption="a summary of the axe errors for the table. none of them are related to our table.",config=Config(group_index=True))
a summary of the axe errors for the table. none of them are related to our table.
[{'any': [], 'all': [{'id': 'page-has-main', 'data': None, 'relatedNodes': [], 'impact': 'moderate', 'message': 'Document does not have a main landmark'}], 'none': [], 'impact': 'moderate', 'html': '<html><head></head><body></body></html>', 'target': ['html'], 'failureSummary': 'Fix all of the following:\n Document does not have a main landmark'}]
page-has-heading-one
moderate
['cat.semantics', 'best-practice']
Ensure that the page, or at least one of its frames contains a level-one heading
[{'any': [], 'all': [{'id': 'page-has-heading-one', 'data': None, 'relatedNodes': [], 'impact': 'moderate', 'message': 'Page must have a level-one heading'}], 'none': [], 'impact': 'moderate', 'html': '<html><head></head><body></body></html>', 'target': ['html'], 'failureSummary': 'Fix all of the following:\n Page must have a level-one heading'}]
[{'any': [{'id': 'doc-has-title', 'data': None, 'relatedNodes': [], 'impact': 'serious', 'message': 'Document does not have a non-empty <title> element'}], 'all': [], 'none': [], 'impact': 'serious', 'html': '<html><head></head><body></body></html>', 'target': ['html'], 'failureSummary': 'Fix any of the following:\n Document does not have a non-empty <title> element'}]
[{'any': [{'id': 'has-lang', 'data': {'messageKey': 'noLang'}, 'relatedNodes': [], 'impact': 'serious', 'message': 'The <html> element does not have a lang attribute'}], 'all': [], 'none': [], 'impact': 'serious', 'html': '<html><head></head><body></body></html>', 'target': ['html'], 'failureSummary': 'Fix any of the following:\n The <html> element does not have a lang attribute'}]
impact
id
impact
tags
description
help
helpUrl
nodes
min
None
None
None
None
None
None
max
None
None
None
None
None
None
this might be one of the most naturally accessible documents i've written.