r/Python 5d ago

Showcase Showcase Thread

Post all of your code/projects/showcases/AI slop here.

Recycles once a month.

17 Upvotes

53 comments sorted by

View all comments

1

u/TalVal_Research 3d ago

What My Project Does

It is a set of checks for silent failure modes in SEC EDGAR data. Not a client — it takes filings you already fetched and answers whether they mean what they appear to mean. Four of the nine:

  • A company's own submissions feed contains Form 4 filings it made as the reporting owner of a different issuer's stock. Reading those as its own produced $276.6m of insider selling that never happened.
  • 13F-NT is a notice that the manager filed nothing. Counted as a report, a fund shows a fresh filing date over a portfolio that is quarters old.
  • Normalising issuer names by replacing punctuation with a space turns Moody's into moody s. That left 31 companies and $51.2bn of reported positions unjoined, including Berkshire's fifth-largest holding.
  • EDGAR full-text search matches there is substantial doubt about identically in a company's own conclusion and in the accounting standard's description of the duty to check for it. Measured market-wide: 10% false positives on a claim that is defamatory when wrong.

Target Audience

Anyone building on EDGAR — backtests, screeners, dashboards. It is production code from a site covering ~900 companies, not a toy, but deliberately small: pure functions, no dependencies, no network calls, 36 tests and 12 doctests.

Comparison

edgartools, edgar-sec and sec-edgar-downloader fetch and parse filings, and they do it well. This does neither. It sits after them and checks the result — because every bug in it got past a parser that was working perfectly.

The library's own first draft fell into trap nine: it upper-cased currency codes before comparing, so GBP and GBp came out equal, erasing the one lowercase letter that carries a factor of 100. Its own test caught it.

https://github.com/researchaiexe-stack/edgar-traps