Replies: 2 comments 3 replies
-
Ill do a writeup later today. This is something that XBRL has support for
but…. I need to catch a ferry to to to class … so TTFN
René (he/him)
…On Tue, Jan 16, 2024 at 2:31 AM galigutta ***@***.***> wrote:
Hi, I have looked around a bit, and I am struggling to figure out how to
embed the facts in the calculation_link to get a view of the various tables
in the filing.
Specifically the problem I am running into is that the concepts of facts
need to be combined with concept of the
taxonomy.linked_riles.calculation_link under different contexts. How is
this done? it does does seem to get more complicated with near similar
facts in the instance. Would anyone be kind enough to post their code to
accomplish this?
—
Reply to this email directly, view it on GitHub
<#122>, or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AKYVRLXN57YAWISCTK37HRLYOZJJFAVCNFSM6AAAAABB4SB62CVHI2DSMVQWIX3LMV43ERDJONRXK43TNFXW4OZWGA4DCNBYGM>
.
You are receiving this because you are subscribed to this thread.Message
ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
3 replies
-
I think I solved this. here for posterity. Of course if any one know a better way please chime in. This was more straightforward than I was thinking. def get_facts_by_xml_id(inst, xml_id):
return [fact for fact in inst.facts if fact.concept.xml_id == xml_id]
def get_label_by_xml_id(inst, xml_id):
for i in inst.taxonomy.lab_linkbases[0].extended_links[0].root_locators:
if i.concept_id == xml_id:
return(i.children[0].labels[0].text)
# concept_str comes from linkbases
concept_str = 'us-gaap_RevenueFromContractWithCustomerExcludingAssessedTax'
filtered_facts = get_facts_by_xml_id(inst, concept_str)
label = get_label_by_xml_id(inst, concept_str)
print(label)
for fact in filtered_facts:
if len(fact.context.segments) == 0:
print(fact.value)
print(fact.context) |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi, I have looked around a bit, and I am struggling to figure out how to embed the facts in the calculation_link to get a view of the various tables in the filing.
Specifically the problem I am running into is that the concepts of facts need to be combined with concept of the taxonomy.linked_roles.calculation_link under different contexts. How is this done? it does seem to get more complicated with near similar facts in the instance. Would anyone be kind enough to post their code to accomplish this?
Beta Was this translation helpful? Give feedback.
All reactions