Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
role_ref_tags = xbrl_dir.xbrl.find_all("link:roleRef")
role_ref_elements = [t.element for t in role_ref_tags]
role_refs = {}
for e in role_ref_elements:
role_refs[e["roleURI"]] = e["xlink:href"]
roles = {}
for r in role_refs:
role_name =[r]).element.find("link:definition").text
roles[role_name] = r
# Show roles
for r in roles:
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment