Skip to content

Commit

Permalink
make sure dir exists for saving v2 csv files
Browse files Browse the repository at this point in the history
  • Loading branch information
ChenglimEar committed Nov 3, 2023
1 parent 2e0387d commit b6b668e
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions download/main.py
Original file line number Diff line number Diff line change
Expand Up @@ -82,9 +82,11 @@ def main():
'XRef_Match',
]).sample(n=20))

elections.df.to_csv('downloads/csv/elections_v2.csv', index=False)
committees.df.to_csv('downloads/csv/committees_v2.csv', index=False)
a_contributions.df.to_csv('downloads/csv/a_contributions_v2.csv', index=False)
to_csv_dirpath = 'downloads/csv'
os.makedirs(to_csv_dirpath, exists_ok=True)
elections.df.to_csv(f'{to_csv_dirpath}/elections_v2.csv', index=False)
committees.df.to_csv(f'{to_csv_dirpath}/committees_v2.csv', index=False)
a_contributions.df.to_csv(f'{to_csv_dirpath}/a_contributions_v2.csv', index=False)

'''
with engine.connect() as conn:
Expand Down

0 comments on commit b6b668e

Please sign in to comment.