| --- |
| language: |
| - en |
| license: |
| - other |
| size_categories: |
| - 100M<n<1B |
| task_categories: |
| - tabular-classification |
| - tabular-regression |
| tags: |
| - finance |
| - sec |
| - edgar |
| - duckdb |
| - datapond |
| --- |
| |
| # SEC EDGAR Financial Statement Data Sets |
|
|
| This dataset contains structured, numeric data extracted from corporate financial statements (10-K, 10-Q, 8-K, etc.) filed with the U.S. Securities and Exchange Commission (SEC). |
|
|
| It has been processed into a highly compressed, instantly queryable **DuckDB** database as part of the [Datapond](https://datapond-db.github.io/website/) open-source registry. |
|
|
| ## Dataset Details |
| - **Source:** [U.S. Securities and Exchange Commission](https://www.sec.gov/dera/data/financial-statement-data-sets) |
| - **Timeframe:** 15 Years (2009 to 2026) |
| - **Format:** DuckDB (`sec_edgar.duckdb`) |
| - **Row Count:** ~231.5 Million rows |
| - **Size:** ~5.27 GB |
| - **License:** Public Domain |
|
|
| ## How to use with Datapond |
|
|
| Since this database is hosted on Hugging Face, you can query it **remotely over HTTP** without downloading the entire 1GB file! |
|
|
| First, install the Datapond Python client: |
| ```bash |
| pip install datapond |
| ``` |
|
|
| Then, execute SQL directly against this repository: |
| ```python |
| import datapond |
| |
| # Connect to the remote DuckDB file |
| con = datapond.connect("sec_edgar") |
| |
| # Query the database |
| df = con.execute(""" |
| SELECT s.name, n.tag, n.value, n.ddate |
| FROM numbers n |
| JOIN submissions s ON n.adsh = s.adsh |
| WHERE n.tag = 'NetIncomeLoss' |
| LIMIT 10 |
| """).df() |
| |
| print(df) |
| ``` |
|
|
| ## Schema |
|
|
| *For a complete list of columns, data types, and definitions, please refer to the [DICTIONARY.md](DICTIONARY.md) file.* |
|
|
| The database contains the following core tables: |
| - `submissions` (`sub.txt`): Index of all filings, company names, industry codes, and filing dates. |
| - `numbers` (`num.txt`): The actual numeric financial data points (Assets, Liabilities, Net Income, etc.). |
| - `presentations` (`pre.txt`): How line items are presented in the statements. |
| - `tags` (`tag.txt`): Definitions and labels for the XBRL financial tags. |
| - `_metadata`: Required Datapond registry metadata. |
|
|
| ## How to Build |
|
|
| If you wish to rebuild the database locally from the raw SEC files: |
|
|
| 1. (Optional) If you want the script to automatically generate the Datapond `DICTIONARY.md`, ensure the Datapond registry repository is cloned in a sibling directory: |
| ```bash |
| git clone https://github.com/datapond-db/registry.git ../registry |
| ``` |
|
|
| 2. Ensure you have `uv` installed, then set your SEC user agent (required by the SEC EDGAR API to prevent rate-limiting/blocks): |
| ```bash |
| # On Windows PowerShell |
| $env:SEC_USER_AGENT="Your Name your.email@example.com" |
| |
| # On Mac/Linux |
| export SEC_USER_AGENT="Your Name your.email@example.com" |
| ``` |
|
|
| 3. Run the orchestration script: |
| ```bash |
| uv run python main.py |
| ``` |
| *(Tip: You can run a quick test build of just the last 4 quarters instead of the full 15-year dataset by passing `--quarters 4`)* |
|
|
| This script will: |
| - Download the raw ZIP files from the SEC |
| - Ingest them using explicit `schema.sql` strict typing |
| - Apply data transformations (e.g., date parsing, zero-padding CIKs) |
| - Generate Datapond `_columns` and `DICTIONARY.md` (if the registry repo exists) |
| - Clean up all temporary `raw/` files |
|
|
| ## Citation |
|
|
| If you use this dataset in your research or application, please cite the U.S. Securities and Exchange Commission (SEC) as the data source: |
|
|
| ```bibtex |
| @misc{sec_edgar_financial_statement_data_sets, |
| author = {{U.S. Securities and Exchange Commission}}, |
| title = {Financial Statement Data Sets}, |
| year = {2026}, |
| url = {https://www.sec.gov/dera/data/financial-statement-data-sets}, |
| note = {Data extracted from corporate financial statements filed with the SEC.} |
| } |
| ``` |
|
|