
Research
Security News
Malicious npm Packages Use Telegram to Exfiltrate BullX Credentials
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Open-ESEF is a Python-based, open-source project designed to handle XBRL (eXtensible Business Reporting Language) filings, specifically those adhering to the ESEF (European Single Electronic Format) standard.
ESEF is the mandated digital reporting format for annual financial reports of listed companies in the European Union, established by the European Securities and Markets Authority (ESMA). Open-ESEF provides a robust toolkit for parsing, validating, and analyzing these ESEF XBRL filings.
Funding Acknowledgment (DFG): Funded by the Deutsche Forschungsgemeinschaft (DFG, German Research Foundation) β Collaborative Research Center (SFB/TRR) Project-ID 403041268 β TRR 266 Accounting for Transparency.
Open-ESEF is under active development. Stay tuned for updates and new features as the project progresses!
To install the latest stable version:
pip install openesef
Clone the Repository:
git clone https://github.com/reeyarn/openesef.git
cd openesef
Install Dependencies and Build Package:
# Install Cython first
pip install cython
# Install the package in development mode with Cython compilation
pip install -e .
Note: The package will automatically compile the Cython extensions during installation. If you modify any .pyx files, you'll need to reinstall the package using pip install -e .
again.
python -c "from openesef import base, taxonomy, instance; import openesef.engines.tax_pres as oetp; print('Open-ESEF installed successfully!')"
Explore the Example and output with Notebooks: examples/apple_2020.ipynb
Load XBRL filing using ticker and year
from openesef.edgar.loader import load_xbrl_filing
from openesef.engines.tax_pres import TaxonomyPresentation
# Load XBRL filing using ticker and year
xid, tax = load_xbrl_filing(ticker="AAPL", year=2020)
# OR Load using filing URL:
# xid, tax = load_xbrl_filing(filing_url="/Archives/edgar/data/320193/0000320193-20-000096.txt")
Create presentation object to analyze statements and concepts
t_pres = TaxonomyPresentation(tax)
# Print statement names
print("\nFinancial Statements:")
for statement in t_pres.statement_dimensions.keys():
print(f"- {statement}")
Get concepts from Statement of Operations
print("\nConcepts in Statement of Operations:")
statement_concepts = t_pres.statement_concepts.get('CONSOLIDATEDSTATEMENTSOFOPERATIONS', [])
concepts_statement_of_operations = []
for concept in statement_concepts:
concepts_statement_of_operations.append(concept['concept_qname'])
print(f"Statement: {concept['statement_name']}")
print(f"Concept: {concept['concept_qname']}")
print(f"Label: {concept['label']}")
Print fact values for Statement of Operations concepts
print("\nFact Values:")
for key, fact in xid.xbrl.facts.items():
concept_qname = str(fact.qname)
context = xid.xbrl.contexts[fact.context_ref]
if concept_qname in concepts_statement_of_operations:
print(f"{concept_qname:<90} Value: {fact.value:<15} ")
In this forked repository, I began by adapting the code from the fractalexperience/xbrl/
package to facilitate its compatibility with ESEF.
The issue in that repository was that, unlike US-SEC-EDGAR, ESEF files adhere to a folder structure. Consequently, the schema references in ESEF files are relative to the instance file rather than the taxonomy folder, and fractalexperience/xbrl/
package did not handle this out of the box. Using SAP SE 2022 ESEF filing as an example, the ESEF filing root folder contains the following folders and files:
π¦ sap-2022-12-31-DE
βββ π¦ META-INF
β βββ π catalog.xml
β βββ π taxonomyPackage.xml
βββ π¦ reports
β βββ π sap-2022-12-31-DE.xhtml
βββ π¦ www.sap.com
βββ π sap-2022-12-31.xsd
βββ π sap-2022-12-31_cal.xml
βββ π sap-2022-12-31_def.xml
βββ π sap-2022-12-31_lab-de.xml
βββ π sap-2022-12-31_lab-en.xml
βββ π sap-2022-12-31_pre.xml
I have tried to modify the code to handle ESEF by adding the esef_filing_root
parameter and passing it around.
Explore the example with code: examples/try_vw2020.py
This project supports the European Single Electronic Format (ESEF), established by the European Securities and Markets Authority (ESMA) as the mandated digital reporting standard for annual financial reports of listed companies in the European Union. The ESEF specifications and guidelines are sourced from ESMAβs official publications and are adhered to in this implementation. For more information, visit esma.europa.eu.
This project leverages the IFRS Taxonomy, developed and maintained by the IFRS Foundation, to process XBRL filings based on International Financial Reporting Standards (IFRS). The taxonomy files are sourced from the IFRS Foundationβs official repository and are used in accordance with their terms of use. For more information, visit ifrs.org.
This project utilizes the US GAAP Financial Reporting Taxonomy, developed and maintained by the Financial Accounting Standards Board (FASB) and XBRL US. The taxonomy files (e.g., us-gaap-YYYY-MM-DD.xsd
) are sourced from xbrl.fasb.org and are used in compliance with their terms of use. For more information, visit fasb.org and xbrl.us.
The use of these standards and taxonomies is intended to support educational and research purposes in alignment with the open-source goals of this project. If any use herein is found to infringe upon the rights of the FASB, XBRL US, ESMA, or the IFRS Foundation, please contact the author at reeyarn+github.openesef@gmail.com, and I will promptly remove or adjust the offending content to address any concerns.
Open-ESEF builds upon and extends the excellent work of these open-source projects:
fractalexperience/xbrl/
): Provides the foundation for XBRL parsing, taxonomy handling, and data modeling. Open-ESEF adapts and extends this library to handle ESEF-specific requirements.farhadab/sec-edgar-financials
): Provides code for interacting with the SEC EDGAR system (modules are currently under review and being streamlined).ifanchu/pyXBRL
): (used the code for the DEI part, aka the document and entity information, such as the current fiscal period, fiscal year end, etc.).ESEF Compliance: Specifically designed to handle XBRL filings in the ESEF format, addressing the unique folder structure and referencing conventions of ESEF reports.
XBRL Taxonomy Management:
XBRL Instance Document Processing:
Data Modeling & Storage:
Cube
class for semantic indexing of facts in a multidimensional space (dimensions: metric, entity, period, unit, custom dimensions).Inline XBRL (iXBRL) Support: Processes iXBRL documents, extracting embedded XBRL data from XHTML reports.
SEC EDGAR Integration:
https://www.sec.gov/files/company_tickers.json
; added edgar.stock.update_symbols_data()
to update the symbols data file.Modular Architecture: Well-structured codebase with clear separation of concerns (base components, taxonomy logic, instance processing, engines).
Logging & Debugging: Detailed logging for taxonomy resolution and instance processing.
[Detailed Architecture Overview (Coming Soon)] - This section will be expanded to provide a more in-depth look at the Open-ESEF architecture.
Key Components:
base
: Core modules providing fundamental classes and utilities (e.g., pool
, resolver
, ebase
, fbase
).taxonomy
: Modules for handling XBRL taxonomies (taxonomy
, schema
, linkbase
, tpack
).instance
: Modules for processing XBRL instance documents (instance
, fact
, context
, unit
, dei
, filing_loader
).engines
: Modules for reporting and data analysis (functionality to be documented).edgar
: Modules for SEC EDGAR filing retrieval (currently being streamlined).filings_xbrl_org
: Interacting with https://filings.xbrl.org/
to get the ESEF filings.util
: Utility functions such as util_mylogger.setup_logger()
.Data Flow (Simplified):
Taxonomy
, Instance
, and Cube
classes.Technical Highlights:
fs.memory
for in-memory file handling and caching.Standards Compliance:
0.3.8
engines/tax_pres.py
engines/ins_facts.py
fact_df = ins_facts(xid, tax)
toedgar/loader.py
added get_xbrl_df()
to replace get_fact_df()
0.3.7
engines.tax_pres.tax_calc_df()
to get the calculation network dataframe0.3.5
engines.tax_pres
by avoiding double for loop for disclosure only facts0.3.1
util.ram_usage.check_memory_usage()
to check the memory usage0.3.0
TaxonomyPresentation
class:
FAQs
An open-source Python library for ESEF XBRL filings
We found that openesef demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago.Β It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
Socket uncovers an npm Trojan stealing crypto wallets and BullX credentials via obfuscated code and Telegram exfiltration.
Research
Security News
Malicious npm packages posing as developer tools target macOS Cursor IDE users, stealing credentials and modifying files to gain persistent backdoor access.
Security News
AI-generated slop reports are making bug bounty triage harder, wasting maintainer time, and straining trust in vulnerability disclosure programs.