Skip to content

Commit

Permalink
Added footnote attribute to AbstractFact #27
Browse files Browse the repository at this point in the history
  • Loading branch information
manusimidt committed Jun 4, 2021
1 parent 1d14749 commit 2248fad
Showing 1 changed file with 21 additions and 0 deletions.
21 changes: 21 additions & 0 deletions xbrl/instance.py
Original file line number Diff line number Diff line change
Expand Up @@ -179,6 +179,7 @@ def __init__(self, concept: Concept, context: AbstractContext, value: any) -> No
self.concept: Concept = concept
self.context: AbstractContext = context
self.value: any = value
self.footnote: Footnote or None = None

This comment has been minimized.

Copy link
@manusimidt

manusimidt Jun 4, 2021

Author Owner

A fact can have multiple Footnotes (i.e in different Languages...).
Thus this has to be an array.


def __str__(self) -> str:
return "{}: {}".format(self.concept.name, str(self.value))
Expand Down Expand Up @@ -219,6 +220,26 @@ def __init__(self, concept: Concept, context: AbstractContext, value: str) -> No
super().__init__(concept, context, value)


class Footnote:
"""
Class representing a footnote
https://www.xbrl.org/Specification/XBRL-2.1/REC-2003-12-31/XBRL-2.1-REC-2003-12-31+corrected-errata-2013-02-20.html#_4.11
XML Example:
<link:footnote id=".." xlink:label=".." xlink:role="http://www.xbrl.org/2003/role/footnote" xlink:type="resource"
xml:lang="en-US">The domestic loss in 2020 versus domestic income in 2019 was mainly related to the ... </link:footnote>
"""

def __init__(self, content: str, lang: str) -> None:
"""
:param content: content of the footnote
:param lang: language of the footnote
"""
self.content = content
self.lang = lang


class XbrlInstance(abc.ABC):
"""
Class representing a xbrl instance file
Expand Down

0 comments on commit 2248fad

Please sign in to comment.