The SEC documents that a submissions response keeps recent filing history in compact columnar arrays, and Python 3.12 documents the standard JSON decoder needed to read a saved response. This offline recipe checks that the four requested arrays are present and equally long before pairing their entries. It does not contact the SEC or infer anything about a company or product.
Before you start
- Intended runner: Python 3.12; no third-party packages or network access are required. This is not a claim of a tested minimum Python version.
- Provide a local UTF-8 JSON file or pipe JSON to stdin using `-`; the input must represent an SEC submissions object with `filings.recent`.
- For non-empty records, each selected array entry must be a string. The code does not validate date formats, accession-number formats, or document names beyond that type check.
Build and check
- Save the proposed code as `sec_recent.py`.
- Create a small synthetic JSON fixture using the four arrays shown in `example_input`.
- Run the fixture with `python3.12 sec_recent.py fixture.json` and check that each output row keeps the fields from the same array index together.
- Run the same fixture through stdin with `python3.12 sec_recent.py - < fixture.json` and compare the output.
- Change one array to a different length and confirm the program rejects it rather than pairing incomplete rows.
- Set all four arrays to empty lists and confirm it prints the explicit empty-record message.
Limits to understand
- Only summarizes `filings.recent`; it does not read older filing-history files mentioned by SEC documentation.
- This offline processor does not establish whether a saved response is current, complete, authentic, or actually retrieved from the SEC.
- The recipe rejects unequal array lengths and non-string values in records, but does not impose additional SEC schema rules.
- A missing file, unreadable file, malformed JSON, missing object path, missing array, or invalid record produces an error on stderr and exit status 2.
- There are no network calls, so no timeout or retry behavior applies.
- The Python JSON documentation cautions that parsing untrusted, very large JSON can consume significant CPU and memory; use appropriately bounded local input.
What this example adds
This provides a small, local integrity check for SEC submissions data: it verifies the four parallel arrays before aligning them, handles a valid empty recent list explicitly, and reports malformed input on stderr with a nonzero exit. It summarizes only the requested filing fields; it does not fetch data, modify any service, or make company or product inferences.
Run it
Run with Python 3.12: `python3.12 sec_recent.py saved-submissions.json`. To read from stdin, use `python3.12 sec_recent.py - < saved-submissions.json`.Example input
{"filings":{"recent":{"form":["10-K","8-K"],"filingDate":["2025-02-20","2025-03-01"],"accessionNumber":["0000000000-25-000001","0000000000-25-000002"],"primaryDocument":["annual.htm","event.htm"]}}}Expected output
Recent filing records: 2
1. 10-K | 2025-02-20 | 0000000000-25-000001 | annual.htm
2. 8-K | 2025-03-01 | 0000000000-25-000002 | event.htm
