Skip to content

Commit

Permalink
Fixed some minor bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
manusimidt committed Apr 26, 2021
1 parent 80a9c11 commit 4595768
Show file tree
Hide file tree
Showing 3 changed files with 2 additions and 4 deletions.
1 change: 0 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,6 @@ cache: HttpCache = HttpCache('./cache')
# Websites like the SEC require you to disclose information about your bot! (https://www.sec.gov/privacy.htm#security)
cache.set_headers({'From': '[email protected]', 'User-Agent': 'Tool/Version (Website)'})

# Parse a inline XBRL file that is saved locally
ixbrl_path: str = './data/AAPL/2020_FY/aapl-20201226.htm'
inst: XbrlInstance = parse_ixbrl(ixbrl_path, cache)
```
Expand Down
3 changes: 1 addition & 2 deletions xbrl_parser/linkbase.py
Original file line number Diff line number Diff line change
Expand Up @@ -248,7 +248,7 @@ def __init__(self, label: str, label_type: str, language: str, text: str) -> Non
self.label: str = label
self.language = language
# the label itself i.e: "Defined Benefit Plan Disclosure [Line Items]"
self.text: str = text.strip()
self.text: str = text.strip() if text is not None else text
# the role of the label i.e: http://www.xbrl.org/2003/role/terseLabel
self.label_type: str = label_type

Expand Down Expand Up @@ -492,7 +492,6 @@ def parse_linkbase(linkbase_path: str, linkbase_type: LinkbaseType) -> Linkbase:
label_map = {}
if linkbase_type == LinkbaseType.LABEL:
for label_element in extended_link.findall(LINK_NS + 'label'):
# if the label is empty, just ignore it
label_name: str = label_element.attrib[XLINK_NS + 'label']
label_role: str = label_element.attrib[XLINK_NS + 'role']
label_lang: str = label_element.attrib[XML_NS + 'lang']
Expand Down
2 changes: 1 addition & 1 deletion xbrl_parser/taxonomy.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def parse_common_taxonomy(cache: HttpCache, namespace: str) -> TaxonomySchema or
"http://fasb.org/us-gaap/2020-01-31": "http://xbrl.fasb.org/us-gaap/2020/elts/us-gaap-2020-01-31.xsd",
}
if namespace in ns_schema_map:
return parse_taxonomy(ns_schema_map[namespace], cache)
return parse_taxonomy_url(ns_schema_map[namespace], cache)
return None


Expand Down

0 comments on commit 4595768

Please sign in to comment.