WIP - Add exploration of fetching values from online CSRD report #47
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR contains sample code for fetching a data point from an online CSRD report, that follows the European Sustainability Reporting Standards.
I've uploaded one of the sample example CSRD reports that EFRAF published onto a gist on github at:
https://gist.githubusercontent.com/mrchrisadams/fb14e79d2d52977255c0b1db6de86726/raw/5536eb17470125912a62684789df35a440dbed4a/efrag-2026-12-31-en.xhtml
This is simulates a published CSRD report being online at a remote URL to download,.
The code is now parses it and pulls out the value we care about from the report - it should be a value of something like 23%.
how are finding it
So, for now we're looking for one of the values we list in issue #44 :
In Arelle-speak, this is called:
So we're filtering the list of returned 'facts' in a parsed document, to only return the one we care about, and then returning the value.
Making this more human friendly
It looks like the returned 'fact' does not have a nice easy to read name like E1-5 Percentage of renewable sources in total energy consumption.
We probably want to maintain a mapping between this specific identifier
esrs:PercentageOfRenewableSourcesInTotalEnergyConsumption
inside the system and the slightly more human friendly E1-5 Percentage of renewable sources in total energy consumption, that we want to expose to people.We also likely want to maintain a list of possible mappings, between Arelle and a human friendly representations, particularly when we want to choose between the various other values in listed in #44 .
Acceptance criteria
This wil be considered done when we have
esrs:PercentageOfRenewableSourcesInTotalEnergyConsumption
from a CSRD reportFinal note - I found out that Arelle already knows how to fetch remote CSRD files if they're reachable via http/ https. I had assumed our parser might need to fetch the files first, and then pass along downloaded files to a CSRD processor, for parsing to Arelle. It might actually make sense to just pass along the url of the CSRD report, assuming Arelle's handling logic works how we expect it to.