Skip to content

Commit

Permalink
Small logging update for school scrape
Browse files Browse the repository at this point in the history
  • Loading branch information
peteb206 authored Dec 4, 2024
1 parent 272705a commit ecd69d5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions scrape.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,16 @@ def get_schools() -> pd.DataFrame:

# Drop rows not found in new data
rows_to_delete_df = compare_df[compare_df['source'] == 'left_only'][schools_df.columns].reset_index(drop = True)
print('\n\nSchools to Delete:')
print(rows_to_delete_df.to_string())
print(f'\n\n{len(rows_to_delete_df.index)} Schools to Delete:')
if len(rows_to_delete_df.index) > 0:
print(rows_to_delete_df.to_string())

# Add rows not found in existing data
rows_to_add_df = compare_df[compare_df['source'] == 'right_only'][schools_df.columns].reset_index(drop = True)
print('\n\nSchools to Add:')
print(rows_to_add_df.to_string())
print('')
print(f'\n\n{len(rows_to_add_df.index)} Schools to Add:')
if len(rows_to_add_df.index) > 0:
print(rows_to_add_df.to_string())
print('')

def reset_roster_scrape_results():
schools_worksheet = google_sheets.hub_spreadsheet.worksheet('Schools')
Expand Down

0 comments on commit ecd69d5

Please sign in to comment.