edgartools icon indicating copy to clipboard operation
edgartools copied to clipboard

issue with cash and cash equivalents for multiyear data IESC

Open miruddfan opened this issue 10 months ago • 6 comments

Issue Type

  • [x ] Data Quality Issue (incorrect financial values, missing data)
  • [x ] XBRL Parsing Issue (statement rendering, concept mapping)
  • [ ] Filing Access Issue (download failures, attachment problems)
  • [ ] Performance Issue (slow operations, memory problems)
  • [ ] Compatibility Issue (platform/dependency conflicts)
  • [ ] Documentation Issue (unclear instructions, missing examples)

Environment

EdgarTools Version:5.9.1 Python Version:3.10.19 Operating System:win

Bug Description

What you expected to happen: the balance sheet for multi years would be preserved

What actually happened: Missing 2023 cash and cash equivalents. 2022, 2021 on different lines. It may be an issue with two similar label and concept lines for these annual reports. I tried to reproduce with MSFT, but did not have the same issue.

Company = IESC number_years = 5 (same issue for 3, 4, etc) Error message (if any):

None

Reproduction

Company/Ticker:IESC Time Period:2025 - 2021 Relevant Forms: 10-K

Minimal code to reproduce:

# Paste the minimal code that reproduces the issue
from edgar import Company


# 2. Input company ticker
company_ticker = input("Enter company ticker (e.g., MSFT): ").upper()
number_years = int(input("Enter the number(years) of annual reports desired = "))
data['company_ticker'] = company_ticker
company = Company(company_ticker)
filings = company.get_filings(form="10-K").head(number_years)

xbrls = XBRLS.from_filings(filings)

stitched_statements = xbrls.statements

balance_sheet = stitched_statements.balance_sheet()
bs_df = balance_sheet.to_dataframe()

bsheet_string = "_Balance_Sheets.csv"
csv_filename = f"{ticker}{bsheet_string}"
bs_df.to_csv(csv_filename, index=False)

# ... rest of reproduction code

Additional Context

I cannot find a format in the IESC annual reports that would lead to two lines for Cash and Cash Equivalents. Looking through the years 2025 - 2021, there is something a bit weird with the results. I tried to reproduce with get_financials, but I did not know how to use the get_financials command and limit it to year 2023 (for example)


This issue will be handled using EdgarTools' systematic issue resolution workflow. A reproduction test will be created to verify the fix.

miruddfan avatar Jan 22 '26 17:01 miruddfan

Issue Confirmed - Multi-Year Stitching Concept Normalization Gap

Thank you for the detailed bug report @miruddfan! I've successfully reproduced this issue with IESC's 10-K filings.

What's Happening

When stitching IESC's balance sheets across 5 years, cash appears on three separate rows instead of a single consolidated row because IESC changed their primary cash concept across different fiscal years, and EdgarTools' concept standardization system doesn't recognize these as equivalent concepts that should be merged.

Root Cause

The multi-year stitching logic uses the XBRL concept as the primary key for merging rows. Different concepts = different rows. The standardization system (ConceptMapper) is designed to handle this, but doesn't currently have mappings for these cash concept variants.

Why This Is NOT a Data Accuracy Issue

The data is accurate - all cash values are present in the output. This is a presentation issue where the data should be consolidated into a single row for better UX.

Single-year statements work correctly:

filing_2023 = company.get_filings(form='10-K').filter(filing_date='2023-12-07')[0]
xbrl_2023 = filing_2023.xbrl()
bs_2023 = xbrl_2023.statements.balance_sheet()
# Shows: "Cash, Cash Equivalents, and Short-Term Investments"

Workaround (Immediate)

For now, if you need consolidated data, you can:

  1. Use single-year statements per filing (works correctly)
  2. Post-process the DataFrame to merge cash rows yourself
  3. Use Company Facts API which uses a different data source:
from edgar import Company
company = Company("IESC")
facts = company.get_facts()
cash_facts = facts.filter(concept="CashAndCashEquivalents")

Fix Plan

Classification: Normal bug (not critical - data accurate, workaround available)
Priority: P2 (Medium)
Timeline: Scheduled for v5.13.0 (next minor release)
Estimated Effort: 1-2 days

Solution: Enhance the concept standardization system to recognize and normalize common cash concept variants:

  • Add mapping rules for us-gaap_Cash* concept variations
  • Ensure backward compatibility with MSFT and other companies
  • Add regression test specifically for IESC multi-year stitching

Next Steps

  1. Created Beads tracking issue: edgartools-bz65
  2. Added to roadmap for v5.13.0
  3. Will update this issue when fix is implemented

Thank you for the detailed report - this will improve the multi-year stitching experience for companies that change their concept structure across years!


Triaged using EdgarTools Issue-PM Integration Protocol

dgunning avatar Jan 24 '26 15:01 dgunning

I should add to this that multi year stitching needs some work in edgartools. I need to spend some time to either improve it or deprecate it in favour of the SEC bulk financial apis. This is something we should discuss

dgunning avatar Jan 24 '26 15:01 dgunning

Dwight Thanks for the heads up. I just built exactly what I want from the stitching methods, now I just need to update my regex to grab the info across different companies. I can send the first part of the code, so you can see what I am doing

On Sat, Jan 24, 2026 at 10:52 AM Dwight Gunning @.***> wrote:

dgunning left a comment (dgunning/edgartools#610) https://github.com/dgunning/edgartools/issues/610#issuecomment-3794850024

I should add to this that multi year stitching needs some work in edgartools. I need to spend some time to either improve it or deprecate it in favour of the SEC bulk financial apis. This is something we should discuss

— Reply to this email directly, view it on GitHub https://github.com/dgunning/edgartools/issues/610#issuecomment-3794850024, or unsubscribe https://github.com/notifications/unsubscribe-auth/B34Y4NKJXD4ELWQGPM5LZCT4IOINBAVCNFSM6AAAAACSSDMPZ6VHI2DSMVQWIX3LMV43OSLTON2WKQ3PNVWWK3TUHMZTOOJUHA2TAMBSGQ . You are receiving this because you were mentioned.Message ID: @.***>

miruddfan avatar Jan 24 '26 16:01 miruddfan

I'd love to see that

dgunning avatar Jan 24 '26 16:01 dgunning

@dgunning I am working through several examples and I have found some stitching issues. I will be updating this spreadsheet over the next several days. I am comparing the stitching method with get_finacials(). All lines provided are based on the get_financials() methodology.

Stocks impacted so far: V, BRO, APD, GMED, GNTX, TGLS, several of these are with Cash and short term investments

New file added:

EdgarTools Stitching Issues.xlsx

miruddfan avatar Jan 25 '26 19:01 miruddfan

Fixed in Release 5.22.0

dgunning avatar Mar 09 '26 01:03 dgunning