{"id":41913652,"url":"https://github.com/newsdev/fec2json","last_synced_at":"2026-01-25T16:16:12.260Z","repository":{"id":39762398,"uuid":"121421757","full_name":"newsdev/fec2json","owner":"newsdev","description":"turn fec files into json","archived":false,"fork":false,"pushed_at":"2022-07-05T21:09:32.000Z","size":106,"stargazers_count":10,"open_issues_count":3,"forks_count":5,"subscribers_count":10,"default_branch":"master","last_synced_at":"2024-03-25T23:17:53.360Z","etag":null,"topics":["fec"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/newsdev.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":"2018-02-13T18:46:30.000Z","updated_at":"2023-03-28T10:45:20.000Z","dependencies_parsed_at":"2022-09-07T11:13:28.301Z","dependency_job_id":null,"html_url":"https://github.com/newsdev/fec2json","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/newsdev/fec2json","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Ffec2json","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Ffec2json/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Ffec2json/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Ffec2json/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/newsdev","download_url":"https://codeload.github.com/newsdev/fec2json/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/newsdev%2Ffec2json/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28755127,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-25T13:59:49.818Z","status":"ssl_error","status_checked_at":"2026-01-25T13:59:33.728Z","response_time":113,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"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":["fec"],"created_at":"2026-01-25T16:16:11.638Z","updated_at":"2026-01-25T16:16:12.255Z","avatar_url":"https://github.com/newsdev.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# fec2json\nturn fec files into json\n\nwork in progress, not yet trustworthy\n\n\nThe purpose of this library is to turn files from the fec format into json.\n\n## Running\nRequires python3.x. To install dependencies, `pip install -r requirements.txt`. We recommend you do that in a virtual enviromnet.\n\n### CLI:\n`fec2json --path path/to/filing`\n\nWrites json to stdout.\n\nTakes the following optional commandline arguments\n* `--fecfile` if you have .fec files instead of .csv files (no argument needed, this stores a boolean, we assume it's csv if not specified)\n* `--filing_id` to specify the filing id. If not specified, we assume it is the filename minus the directory path and extension.\n\n### Library:\nThe code can currently be cloned from github and used as a library in another python app. TKTK: pip.\n\n## Output\n\nThe json will have the following keys:\n\n### from the first line of the fec file:\n* record_type\n* electronic_filing_type\n* fec_version_number\n* software_name\n* software_version\n* report_id\n* report_type\n* header_comment\n* amends_filing (pulled from report_id)\n\n### from the second line of the fec file\n* amendment (whether the file is amended)\n* form (the form type minus the `N` or `A`)\n* remaining fields depend on the form type and come from the relevant [fec csv source file](https://github.com/newsdev/fec-csv-sources)\n\n\n### from the itemizations\n* itemizations, an object which includes keys for each sked type\n  * each of those keys points to a list of itemization objects of the relevant type. The keys for those innermost objects are determined by the relevant [fec csv source file](https://github.com/newsdev/fec-csv-sources)\n  * each itemization also includes filing_id of the filing. The filing ID. The filing ID can be provided as a command line argument when running in command line mode. If it is not provided, we assume the filing's path is of the format `path/to/filing/filing_id.ext`.\n\nFor example, a filing might look like this:\n\n```\n{\n  \"record_type\":\"HDR\",\n  \"electronic_filing_type\":\"FEC\",\n  \"fec_version_number\":\"8.2\",\n  \"software_name\":\"NGP\",\n  \"software_version\":\"8\",\n  \"report_id\":\"\",\n  \"report_type\":\"\",\n  \"header_comment\":\"\",\n  \"form_type\":\"F3N\",\n  \"filer_committee_id_number\":\"C00654178\",\n  \"committee_name\":\"Sara Dady for Congress\",\n  \"change_of_address\":\"\",\n  \"street_1\":\"PO Box 7164\",\n  \"street_2\":\"\",\n  \"city\":\"Rockford\",\n  \"state\":\"IL\",\n  \"zip\":\"61126\",\n  \"report_code\":\"YE\",\n  \"election_code\":\"\",\n  \"election_date\":\"\",\n  \"election_state\":\"IL\",\n  \"election_district\":\"16\",\n  \"state_of_election\":\"\",\n  \"coverage_from_date\":\"20171001\",\n  \"coverage_through_date\":\"20171231\",\n  \"treasurer_last_name\":\"Lashock\",\n  \"treasurer_first_name\":\"Gwen\",\n  \"treasurer_middle_name\":\"\",\n  \"treasurer_prefix\":\"\",\n  \"treasurer_suffix\":\"\",\n  \"date_signed\":\"20180131\",\n  \"col_a_total_contributions_no_loans\":\"54485.57\",\n  \"col_a_total_contributions_refunds\":\"255.00\",\n  \"col_a_net_contributions\":\"54230.57\",\n  \"col_a_total_operating_expenditures\":\"72966.66\",\n  \"col_a_total_offset_to_operating_expenditures\":\"0.00\",\n  \"col_a_net_operating_expenditures\":\"72966.66\",\n  \"col_a_cash_on_hand_close_of_period\":\"23164.12\",\n  \"col_a_debts_to\":\"0.00\",\n  \"col_a_debts_by\":\"0.00\",\n  \"col_a_individual_contributions_itemized\":\"30420.00\",\n  \"col_a_individual_contributions_unitemized\":\"22850.57\",\n  \"col_a_total_individual_contributions\":\"53270.57\",\n  \"col_a_political_party_contributions\":\"0.00\",\n  \"col_a_pac_contributions\":\"1100.00\",\n  \"col_a_candidate_contributions\":\"115.00\",\n  \"col_a_total_contributions\":\"54485.57\",\n  \"col_a_transfers_from_authorized\":\"0.00\",\n  \"col_a_candidate_loans\":\"0.00\",\n  \"col_a_other_loans\":\"0.00\",\n  \"col_a_total_loans\":\"0.00\",\n  \"col_a_offset_to_operating_expenditures\":\"0.00\",\n  \"col_a_other_receipts\":\"0.00\",\n  \"col_a_total_receipts\":\"54485.57\",\n  \"col_a_operating_expenditures\":\"72966.66\",\n  \"col_a_transfers_to_authorized\":\"0.00\",\n  \"col_a_candidate_loan_repayments\":\"0.00\",\n  \"col_a_other_loan_repayments\":\"0.00\",\n  \"col_a_total_loan_repayments\":\"0.00\",\n  \"col_a_refunds_to_individuals\":\"255.00\",\n  \"col_a_refunds_to_party_committees\":\"54485.57\",\n  \"col_a_refunds_to_other_committees\":\"96385.78\",\n  \"col_a_total_refunds\":\"255.00\",\n  \"col_a_other_disbursements\":\"0.00\",\n  \"col_a_total_disbursements\":\"73221.66\",\n  \"col_a_cash_on_hand_beginning_period\":\"41900.21\",\n  \"col_a_total_disbursements_period\":\"73221.66\",\n  \"col_b_total_contributions_no_loans\":\"114759.59\",\n  \"col_b_total_contributions_refunds\":\"1055.00\",\n  \"col_b_net_contributions\":\"113704.59\",\n  \"col_b_total_operating_expenditures\":\"88530.47\",\n  \"col_b_total_offset_to_operating_expenditures\":\"0.00\",\n  \"col_b_net_operating_expenditures\":\"88530.47\",\n  \"col_b_individual_contributions_itemized\":\"73548.96\",\n  \"col_b_individual_contributions_unitemized\":\"37360.63\",\n  \"col_b_total_individual_contributions\":\"110909.59\",\n  \"col_b_political_party_contributions\":\"0.00\",\n  \"col_b_pac_contributions\":\"1100.00\",\n  \"col_b_candidate_contributions\":\"2750.00\",\n  \"col_b_total_contributions\":\"114759.59\",\n  \"col_b_transfers_from_authorized\":\"0.00\",\n  \"col_b_candidate_loans\":\"0.00\",\n  \"col_b_other_loans\":\"0.00\",\n  \"col_b_total_loans\":\"0.00\",\n  \"col_b_offset_to_operating_expenditures\":\"0.00\",\n  \"col_b_other_receipts\":\"0.00\",\n  \"col_b_total_receipts\":\"114759.59\",\n  \"col_b_operating_expenditures\":\"88530.47\",\n  \"col_b_transfers_to_authorized\":\"0.00\",\n  \"col_b_candidate_loan_repayments\":\"0.00\",\n  \"col_b_other_loan_repayments\":\"0.00\",\n  \"col_b_total_loan_repayments\":\"0.00\",\n  \"col_b_refunds_to_individuals\":\"1055.00\",\n  \"col_b_refunds_to_party_committees\":\"0.00\",\n  \"col_b_refunds_to_other_committees\":\"0.00\",\n  \"col_b_total_refunds\":\"1055.00\",\n  \"col_b_other_disbursements\":\"2010.00\",\n  \"col_b_total_disbursements\":\"91595.47\",\n  \"amendment\":false,\n  \"form\":\"F3\",\n  \"itemizations\":{\n    \"SchA\":[\n      {\n        \"form_type\":\"SA11AI\",\n        \"filer_committee_id_number\":\"C00654178\",\n        \"transaction_id\":\"760417\",\n        \"back_reference_tran_id_number\":\"\",\n        \"back_reference_sched_name\":\"\",\n        \"entity_type\":\"IND\",\n        \"contributor_organization_name\":\"\",\n        \"contributor_last_name\":\"Abedrabbo\",\n        \"contributor_first_name\":\"Kamal\",\n        \"contributor_middle_name\":\"\",\n        \"contributor_prefix\":\"\",\n        \"contributor_suffix\":\"\",\n        \"contributor_street_1\":\"515 Verona Dr\",\n        \"contributor_street_2\":\"\",\n        \"contributor_city\":\"Rockford\",\n        \"contributor_state\":\"IL\",\n        \"contributor_zip\":\"611075307\",\n        \"election_code\":\"P2018\",\n        \"election_other_description\":\"\",\n        \"contribution_date\":\"20171228\",\n        \"contribution_amount\":\"1000.00\",\n        \"contribution_aggregate\":\"1000.00\",\n        \"contribution_purpose_descrip\":\"\",\n        \"contributor_employer\":\"Twins Auto Mall\",\n        \"contributor_occupation\":\"Principal\",\n        \"donor_committee_fec_id\":\"\",\n        \"donor_committee_name\":\"\",\n        \"donor_candidate_fec_id\":\"\",\n        \"donor_candidate_last_name\":\"\",\n        \"donor_candidate_first_name\":\"\",\n        \"donor_candidate_middle_name\":\"\",\n        \"donor_candidate_prefix\":\"\",\n        \"donor_candidate_suffix\":\"\",\n        \"donor_candidate_office\":\"\",\n        \"donor_candidate_state\":\"\",\n        \"donor_candidate_district\":\"\",\n        \"conduit_name\":\"\",\n        \"conduit_street1\":\"\",\n        \"conduit_street2\":\"\",\n        \"conduit_city\":\"\",\n        \"conduit_state\":\"\",\n        \"conduit_zip\":\"\",\n        \"memo_code\":\"\",\n        \"memo_text_description\":\"\",\n        \"reference_code\":\"\"\n      }\n    ],\n    \"SchB\":[\n      {\n        \"form_type\":\"SB17\",\n        \"filer_committee_id_number\":\"C00654178\",\n        \"transaction_id\":\"500018114\",\n        \"back_reference_tran_id_number\":\"\",\n        \"back_reference_sched_name\":\"\",\n        \"entity_type\":\"ORG\",\n        \"payee_organization_name\":\"ActBlue Technical Services\",\n        \"payee_last_name\":\"\",\n        \"payee_first_name\":\"\",\n        \"payee_middle_name\":\"\",\n        \"payee_prefix\":\"\",\n        \"payee_suffix\":\"\",\n        \"payee_street_1\":\"366 Summer St\",\n        \"payee_street_2\":\"\",\n        \"payee_city\":\"Somerville\",\n        \"payee_state\":\"MA\",\n        \"payee_zip\":\"021443132\",\n        \"election_code\":\"P2018\",\n        \"election_other_description\":\"\",\n        \"expenditure_date\":\"20171107\",\n        \"expenditure_amount\":\"29.67\",\n        \"semi_annual_refunded_bundled_amt\":\"0.00\",\n        \"expenditure_purpose_descrip\":\"Credit Card Processing FEe\",\n        \"category_code\":\"\",\n        \"beneficiary_committee_fec_id\":\"\",\n        \"beneficiary_committee_name\":\"\",\n        \"beneficiary_candidate_fec_id\":\"\",\n        \"beneficiary_candidate_last_name\":\"\",\n        \"beneficiary_candidate_first_name\":\"\",\n        \"beneficiary_candidate_middle_name\":\"\",\n        \"beneficiary_candidate_prefix\":\"\",\n        \"beneficiary_candidate_suffix\":\"\",\n        \"beneficiary_candidate_office\":\"\",\n        \"beneficiary_candidate_state\":\"\",\n        \"beneficiary_candidate_district\":\"\",\n        \"conduit_name\":\"\",\n        \"conduit_street_1\":\"\",\n        \"conduit_street_2\":\"\",\n        \"conduit_city\":\"\",\n        \"conduit_state\":\"\",\n        \"conduit_zip\":\"\",\n        \"memo_code\":\"\",\n        \"memo_text_description\":\"\",\n        \"reference_to_si_or_sl_system_code_that_identifies_the_account\":\"\"\n      }\n    ]\n  }\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewsdev%2Ffec2json","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnewsdev%2Ffec2json","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnewsdev%2Ffec2json/lists"}