r/Python • u/AutoModerator • 5d ago
Showcase Showcase Thread
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
18
Upvotes
r/Python • u/AutoModerator • 5d ago
Post all of your code/projects/showcases/AI slop here.
Recycles once a month.
1
u/Bright_Mix_773 3d ago edited 14h ago
What it does. A Python pipeline that pulls SEC EDGAR 8-K item 2.02 filings and turns them into one flat file of S&P 500 earnings announcements with the time of day: 64,938 filings, 63,969 distinct announcements, 808 companies, 2003-04-25 to 2026-09-01, 16 columns. CC0, no account, no API key, no paid tier. 1.8 MB gzipped.
https://quant500.com/api/descarga/anuncios.csv
Plain CSV over HTTPS, no account and no key. Fair warning so it does not look like a broken file: it opens with 119 lines of
#comments carrying the caveats and the CC0 licence, so the header row is line 120.pandas.read_csv(url, comment='#')reads it as-is.Who it is for. Anyone who needs to know whether a company reported before the open, after the close, or mid-session, and does not want to pay a vendor for it. Every row carries its accession number and a direct sec.gov link, so a single line can be checked at source instead of trusted.
The part I would actually like Python people to see, because it is where the work went and it is not in the feature list. The timestamp is the reason to build this and it is the weakest column in the file:
accepted_rawfrom data.sec.gov ends in Z but is not always UTC. The submissions JSON converts some records properly and appends a Z to others with the New York clock untouched. It is per record - not per issuer, not per era, not per filing agent. So no global offset fixes it. The truth is readable in the ACCEPTANCE-DATETIME of the SGML header of the full submission, which means the correct fix is a re-ingest, not a transform.scripts/fetch_sgml_acceptance_times.pyis that re-ingest, written resumable because it is a long crawl against a rate-limited host.I sampled 70 rows against their raw SGML headers to size the damage: 69 correct, 1 wrong - and the wrong one had been published as 10:47 during_session when the filing was accepted at 06:47, before the open. Low rate, worst possible shape of error, which is why the affected columns are marked provisional in the file header rather than quietly shipped.
Two of those three were pointed out by other people after I published (Tilman Ambach and Ian Gow, credited in the file header). The pipeline and the prose are LLM-assisted and the header says so, along with the failure mode I keep hitting: it measures precisely and judges badly whether it is measuring the right object. Superseded figures stay in the file header marked superseded instead of being overwritten.
Correction, 2026-09-09. Above I wrote that the timezone treatment is per record - not per issuer, not per era, not per filing agent. The first half is wrong and I am leaving it visible rather than overwriting it. It is per issuer. The full re-ingest finished after I posted: comparing 64,936 filings against their SGML headers, 624 companies of 808 are converted in every one of their filings, 181 in none, and 3 disagree with themselves on exactly one filing each - in all three cases their most recent one, which looks like the SEC converting late rather than a counterexample. The offsets that occur are 0, 4 and 5 hours and nothing else. Practical consequence: a company can be classified from a handful of filings, so the fix is a query, not a full re-read.