Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add opening balance and closing balance to filings #199

Merged
merged 10 commits into from
Apr 19, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
28 changes: 21 additions & 7 deletions Makefile
Original file line number Diff line number Diff line change
@@ -1,24 +1,38 @@

.PHONY : quarterly
quarterly: import/candidates import/CON_2020 import/EXP_2020 import/CON_2021 import/EXP_2021 import/CON_2022 import/EXP_2022 import/CON_2023 import/EXP_2023 import/CON_2024 import/EXP_2024
quarterly: import/candidates import/pacs import/CON_2020 import/EXP_2020 import/CON_2021 import/EXP_2021 import/CON_2022 import/EXP_2022 import/CON_2023 import/EXP_2023 import/CON_2024 import/EXP_2024

.PHONY : nightly
nightly: import/candidates import/CON_2023 import/EXP_2023 import/CON_2024 import/EXP_2024
nightly: import/candidates import/pacs import/CON_2023 import/EXP_2023 import/CON_2024 import/EXP_2024


import/% : _data/sorted/%.csv
python manage.py import_api_data --transaction-type $(word 1, $(subst _, , $*)) \
python manage.py import_transactions --transaction-type $(word 1, $(subst _, , $*)) \
--year $(word 2, $(subst _, , $*)) \
--file $<

import/pac_filings : _data/raw/pac_committee_filings.csv
python manage.py import_pac_filings --file $<

import/candidate_filings : _data/raw/candidate_committee_filings.csv
python manage.py import_candidate_filings --file $<

import/candidates : _data/raw/candidate_committees.csv
python manage.py import_candidate_api_data --file $<
python manage.py import_candidates --file $<

import/pacs : _data/raw/pac_committees.csv
python manage.py import_pac_committees --file $<


_data/raw/%_committees.csv :
wget --no-use-server-timestamps -O $@ "https://openness-project-nmid.s3.amazonaws.com/$*_committees.csv"

_data/raw/%_committee_filings.csv :
wget --no-use-server-timestamps -O $@ "https://openness-project-nmid.s3.amazonaws.com/$*_committees.csv"

_data/raw/candidate_committees.csv :
wget --no-use-server-timestamps -O $@ "https://openness-project-nmid.s3.amazonaws.com/candidate_committees.csv"

_data/sorted/%.csv : _data/raw/%.csv
xsv fixlengths $< | xsv sort -s OrgID,"Report Name" > $@
xsv fixlengths $< | xsv sort -s OrgID,"Report Name","Start of Period","End of Period" > $@

_data/raw/CON_%.csv :
wget --no-use-server-timestamps \
Expand Down
Loading
Loading