{"id":29246825,"url":"https://github.com/publici/fec-loader","last_synced_at":"2025-07-03T23:06:26.360Z","repository":{"id":8692200,"uuid":"59382439","full_name":"PublicI/fec-loader","owner":"PublicI","description":"Loads raw FEC filings into a database","archived":false,"fork":false,"pushed_at":"2023-01-06T02:02:43.000Z","size":748,"stargazers_count":19,"open_issues_count":29,"forks_count":9,"subscribers_count":2,"default_branch":"subcommands","last_synced_at":"2024-04-14T12:19:37.178Z","etag":null,"topics":["campaignfinance","elections","etl","fec","node"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/PublicI.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-05-21T21:35:05.000Z","updated_at":"2023-08-03T02:35:11.000Z","dependencies_parsed_at":"2023-01-11T17:27:01.690Z","dependency_job_id":null,"html_url":"https://github.com/PublicI/fec-loader","commit_stats":null,"previous_names":[],"tags_count":15,"template":false,"template_full_name":null,"purl":"pkg:github/PublicI/fec-loader","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PublicI%2Ffec-loader","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PublicI%2Ffec-loader/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PublicI%2Ffec-loader/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PublicI%2Ffec-loader/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/PublicI","download_url":"https://codeload.github.com/PublicI/fec-loader/tar.gz/refs/heads/subcommands","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/PublicI%2Ffec-loader/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":263416471,"owners_count":23463144,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["campaignfinance","elections","etl","fec","node"],"created_at":"2025-07-03T23:06:25.087Z","updated_at":"2025-07-03T23:06:26.253Z","avatar_url":"https://github.com/PublicI.png","language":"JavaScript","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fec-cli\n\nA set of flexible command line utilities designed to discover, convert and load raw FEC filings into a database in a fast, streaming manner.\n\n`fec` is about nine times faster than similar solutions. For example, on a recent MacBook Air, a 2.3 gigabyte ActBlue filing parses in three minutes instead of 23 minutes.\n\nIt requires [Node](https://nodejs.org/). It uses [fec-parse](https://github.com/PublicI/fec-parse).\n\n## Try\n\nTo try converting a filing to newline-separated JSON without installing fec-loader, paste the following into a terminal:\n```bash\nFILING_ID=1283013; curl -s \"https://docquery.fec.gov/dcdev/posted/\"$FILING_ID\".fec\" | npx -p github:PublicI/fec-loader#subcommands convert $FILING_ID \u003e $FILING_ID\".ndjson\"\n```\n## Install\n\nTo install:\n```bash\nnpm install -g github:PublicI/fec-loader#subcommands\n```\n## Setup\n\nTo set up a Postgres database for FEC filings and the environment variables needed to connect:\n```bash\nexport PGHOST=\u003cdatabase host\u003e PGDATABASE=\u003cdatabase name\u003e PGUSER=\u003cdatabase user\u003e PGPASSWORD=\u003cdatabase password\u003e\nfec init\n```\n\n## Use\n\nTo load a filing from the FEC into a Postgres database, run:\n```bash\nexport PGHOST=\u003cdatabase host\u003e PGDATABASE=\u003cdatabase name\u003e PGUSER=\u003cdatabase user\u003e PGPASSWORD=\u003cdatabase password\u003e\nFILING_ID=1283013; curl -s \"https://docquery.fec.gov/dcdev/posted/\"$FILING_ID\".fec\" | fec convert $FILING_ID --format=psql | psql\n```\n\nTo list the filings available from the FEC's RSS feed run:\n```bash\nfec list --rss\n```\n\nTo load the most recent five filings from the FEC's RSS feed, run:\n\n```bash\nfor url in $(fec list --rss --headers=false --columns=fec_url --format=tsv | head -n 5); do FILING_ID=$(echo $url | tr -dc '0-9'); curl -s \"https://docquery.fec.gov/dcdev/posted/\"$FILING_ID\".fec\" | fec convert $FILING_ID --format=psql | psql -v ON_ERROR_STOP=on --single-transaction; done\n```\n\nTo get just a summary line as JSON:\n```bash\nFILING_ID=1283013; curl -s \"https://docquery.fec.gov/dcdev/posted/\"$FILING_ID\".fec\" | head -n 10 | fec convert | sed -n 2p\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpublici%2Ffec-loader","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpublici%2Ffec-loader","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpublici%2Ffec-loader/lists"}