From 2248fade0abe148d2077289e18845d708c9e5eda Mon Sep 17 00:00:00 2001 From: Manuel Schmidt Date: Fri, 4 Jun 2021 10:18:47 +0200 Subject: [PATCH] Added footnote attribute to AbstractFact #27 --- xbrl/instance.py | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/xbrl/instance.py b/xbrl/instance.py index 08a31c2..669f3f3 100644 --- a/xbrl/instance.py +++ b/xbrl/instance.py @@ -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 def __str__(self) -> str: return "{}: {}".format(self.concept.name, str(self.value)) @@ -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: + The domestic loss in 2020 versus domestic income in 2019 was mainly related to the ... + + """ + + 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