The dataset viewer is not available for this split.
Error code: FeaturesError
Exception: ArrowInvalid
Message: JSON parse error: Invalid value. in row 0
Traceback: Traceback (most recent call last):
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 342, in _generate_tables
df = pandas_read_json(f)
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 38, in pandas_read_json
return pd.read_json(path_or_buf, **kwargs)
~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/pandas/io/json/_json.py", line 815, in read_json
return json_reader.read()
~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/pandas/io/json/_json.py", line 1014, in read
obj = self._get_object_parser(self.data)
File "/usr/local/lib/python3.14/site-packages/pandas/io/json/_json.py", line 1040, in _get_object_parser
obj = FrameParser(json, **kwargs).parse()
File "/usr/local/lib/python3.14/site-packages/pandas/io/json/_json.py", line 1176, in parse
self._parse()
~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/pandas/io/json/_json.py", line 1392, in _parse
ujson_loads(json, precise_float=self.precise_float), dtype=None
~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
ValueError: Expected object or value
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/src/services/worker/src/worker/job_runners/split/first_rows.py", line 244, in compute_first_rows_from_streaming_response
iterable_dataset = iterable_dataset._resolve_features()
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 4645, in _resolve_features
features = _infer_features_from_batch(self.with_format(None)._head())
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2866, in _head
return next(iter(self.iter(batch_size=n)))
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 3073, in iter
for key, pa_table in ex_iterable.iter_arrow():
~~~~~~~~~~~~~~~~~~~~~~^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 2581, in _iter_arrow
yield from self.ex_iterable._iter_arrow()
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 558, in _iter_arrow
for key, pa_table in iterator:
^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/iterable_dataset.py", line 440, in _iter_arrow
for key, pa_table in self.generate_tables_fn(**gen_kwags):
~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 345, in _generate_tables
raise e
File "/usr/local/lib/python3.14/site-packages/datasets/packaged_modules/json/json.py", line 291, in _generate_tables
pa_table = paj.read_json(
io.BytesIO(batch), read_options=paj.ReadOptions(block_size=block_size)
)
File "pyarrow/_json.pyx", line 364, in pyarrow._json.read_json
File "pyarrow/error.pxi", line 155, in pyarrow.lib.pyarrow_internal_check_status
return check_status(status)
File "pyarrow/error.pxi", line 92, in pyarrow.lib.check_status
raise convert_status(status)
pyarrow.lib.ArrowInvalid: JSON parse error: Invalid value. in row 0Need help to make the dataset viewer work? Make sure to review how to configure the dataset viewer, and open a discussion for direct support.
FEC Campaign Finance Database
360,160,461 rows, ten source tables, four views and 237 dictionary entries. Cycles 2004–2026; 111 available source/cycle outcomes and nine expected pre-2010 standalone absences. Seven official header files are recorded separately.
| Table | Rows |
|---|---|
candidate_committee_links |
74,806 |
candidates |
77,688 |
committee_contributions |
5,334,103 |
committee_to_committee |
48,292,895 |
committees |
185,838 |
communication_costs |
25,768 |
electioneering_communications |
1,725 |
independent_expenditures |
635,427 |
individual_contributions |
285,673,429 |
operating_expenditures |
19,858,782 |
Quick start
INSTALL httpfs; LOAD httpfs;
SET memory_limit='128MiB'; SET threads=1; SET max_temp_directory_size='0B';
ATTACH 'https://huggingface.co/datasets/Nason/fec-database/resolve/main/fec.duckdb' AS fec (READ_ONLY);
SELECT CAND_ID,CAND_NAME FROM fec.candidates WHERE cycle=2026 AND CAND_OFFICE='H' ORDER BY CAND_ID LIMIT 5;
R with DBI and duckdb
Install the dependencies once with install.packages(c("DBI", "duckdb")).
library(DBI)
con <- dbConnect(duckdb::duckdb(config = list(memory_limit = "128MiB", threads = "1", max_temp_directory_size = "0B")))
dbExecute(con, "INSTALL httpfs")
dbExecute(con, "LOAD httpfs")
dbExecute(con, "ATTACH 'https://huggingface.co/datasets/Nason/fec-database/resolve/main/fec.duckdb' AS fec (READ_ONLY)")
dbGetQuery(con, "SELECT CAND_ID, CAND_NAME FROM fec.candidates WHERE cycle = 2026 AND CAND_OFFICE = 'H' ORDER BY CAND_ID LIMIT 5")
dbDisconnect(con, shutdown = TRUE)
DuckDB uses HTTP range requests; queries run on your machine and may need substantial memory or download data. A LIMIT does not guarantee a small scan.
Install/upgrade Python with python -m pip install --upgrade datapond (the examples use 0.1.5), or install released R datapond from CRAN with install.packages("datapond"). R 0.1.1 remains a separate development version. The catalog ID is fec.
Snapshot and verification
This is a source-identified snapshot, not a live feed. The current-main URLs above follow the latest publication. For reproducible work, replace main with the immutable dataset revision you downloaded. Source URLs can change without notice; provenance records individual acquisition times, hashes and sizes.
The refresh adds a net 3,832,549 rows relative to the October 18 snapshot. This is not a count of new donors or new cash. Master-table rows are entity/cycle records; transaction rows retain reported multiplicity.
The current official 2022 individual-contributions ZIP has a truncated root member: 23,747,535 physical records with a partial last record. Its 34 official date shards independently reproduce all 63,885,802 typed baseline rows and all four SHA-256 limb sums. This release restores that complete baseline-equivalent cycle. It does not treat the root load as complete.
Strict current-source CSV checks cover all 27 standalone source/cycle partitions. Before publication, strict checks corrected a net 1,199 rows lost by this rebuild’s permissive CSV ingestion across 16 partitions. Of the 27 current typed multisets, 23 match the prior snapshot and four differ. Independent-expenditure raw source counts are reported separately from amendment-filtered final counts. Three current operating-expense sources require normalization of exactly one empty terminal field.
Provenance, dictionary, and the portable snapshot validation bundle record the checks and source identities. The bundle includes a DuckDB 1.5.5 read-only full-fingerprint verifier, source lock, code, tests and MIT license. It does not bundle the database or raw FEC sources and does not provide an offline or one-command source rebuild.
Fingerprint sums are decimal strings to avoid JSON/JavaScript precision loss. Full typed-row multiset fingerprints preserve multiplicity but do not prove hash injectivity. The separate whole-file SHA-256 identifies this database exactly.
Interpretation and source quality
The FEC individual-contributions file covers a subset of reported itemized contributions under rules that changed over time. It is not a census of donations or unique people. Entity IDs recur across cycles: include cycle in joins and aggregate child transactions before combining them.
v_candidate_totals and v_top_donors net specified refund types. v_daily_donations excludes refunds and reports positive non-refund transactions. v_pac_to_candidate selects direct 24K/24Z contributions. These are different measures. For net contributions, account for memo rows, conduit transfers and refunds; avoid join fan-out. Raw name/employer/address strings are not stable donor identities.
Eight malformed nonblank individual-contribution dates from 2016/2018 remain NULL. No guessed date repair was applied. The retained 2022 interpretation removes 14 balanced wrapper quotes and separately preserves 13 malformed literal-quote fields. FEC does not specify quote escaping, so this is a disclosed interpretation choice. Other conversion/framing outcomes are summarized by source partition in the provenance.
Blank fields become NULL; amounts remain DOUBLE, with floating-point rather than exact decimal arithmetic. Source outlier dates, inconsistent amounts and prank filings remain. Inspect anomalous records against filings. Historical comparisons and parsing choices are retained in the immutable prior provenance.
The dictionary has exact base-table null percentages. Null statistics and examples for v_candidate_totals, v_daily_donations, and v_top_donors are unavailable after the 2022 correction. View SQL is unchanged.
Resources and use restrictions
Disk size is not a RAM estimate. Remote queries can transfer much of the file. Contribution views aggregate large tables, and a final LIMIT does not guarantee a small scan. Keep the pre-attachment resource limits in the examples, leave process and disk headroom, and expect larger queries to fail when spill is disabled.
Contributor names and addresses may not be sold or used commercially or to solicit contributions/donations. See the FEC sale-or-use guidance. Public-domain copyright status of government data does not remove this use restriction.
Underlying records: U.S. Federal Election Commission. Build and verification code: MIT. Source repository; original source revision.
Database: 22,717,673,472 bytes (21.16 GiB). SHA-256: 5bde1896d2d243283c87de295642cf2f6bd3ded749ba9beb9e220a89d07f0e54.
- Downloads last month
- 971