Skip to content

Commit

Permalink
zip projects_in_geographies/ and move it into `projects_in_geograph…
Browse files Browse the repository at this point in the history
…ies/`
  • Loading branch information
damonmcc committed Sep 6, 2024
1 parent 9a77c19 commit 342ec15
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 4 deletions.
3 changes: 0 additions & 3 deletions products/cpdb/bash/04_analysis.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,6 @@
#!/bin/bash
source bash/config.sh

# Tables of projects in geographies of interest
python3 -m python.projects_in_geographies

# Summary table by managing and sponsor agency
echo 'Creating summary tables by managing and sponsor agency'
run_sql_file sql/analysis/projects_dollars_mapped_categorized_managing.sql
Expand Down
6 changes: 5 additions & 1 deletion products/cpdb/bash/05_export.sh
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ set_error_traps
run_sql_file sql/_create_export.sql
python3 python/checkbook_spending_by_year.py

# Create and export tables of projects in geographies of interest
python3 -m python.projects_in_geographies

mkdir -p output && (
cd output

Expand All @@ -26,7 +29,8 @@ mkdir -p output && (
shp_export cpdb_projects_pts MULTIPOINT &
shp_export cpdb_projects_poly MULTIPOLYGON &

cp -r ../projects_in_geographies ./
mv ../projects_in_geographies.zip ../projects_in_geographies/
mv ../projects_in_geographies ./

echo $VERSION > version.txt
wait
Expand Down
8 changes: 8 additions & 0 deletions products/cpdb/python/projects_in_geographies.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,3 +62,11 @@ def export_table(table_name: str) -> None:
geography.geography_name,
)
export_table(geography.table_name)

# zip folder with all csv files
print(f"Zipping folder\n\t{OUTPUT_DIR}")
shutil.make_archive(
base_name=OUTPUT_DIR,
format="zip",
root_dir=OUTPUT_DIR,
)

0 comments on commit 342ec15

Please sign in to comment.