Skip to content

Commit

Permalink
fixup! import command for 2025 scorecards FOI data
Browse files Browse the repository at this point in the history
  • Loading branch information
struan committed Nov 7, 2024
1 parent 36225bd commit 8177899
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions crowdsourcer/management/commands/import_2025_foi_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ class Command(BaseCommand):
url_map_file = (
settings.BASE_DIR / "data" / "scorecards-2025" / "foi-private-link-url.csv"
)
new_url_map_file = (
settings.BASE_DIR
/ "data"
/ "scorecards-2025"
/ "updated-foi-private-link-url.csv"
)

combined_foi_file = settings.BASE_DIR / "data" / "combined_foi_data.xlsx"

Expand Down Expand Up @@ -248,6 +254,15 @@ def populate_url_map(self):
self.url_map[row["request_url"]] = row["request_private_link"]
self.url_map[row["project_url"]] = row["request_private_link"]

df = pd.read_csv(
self.new_url_map_file,
)

for _, row in df.iterrows():
self.url_map[row["request_url"].strip()] = row[
"request_private_link"
].strip()

def get_council_lookup(self):
url = get_dataset_url(
repo_name="uk_local_authority_names_and_codes",
Expand Down

0 comments on commit 8177899

Please sign in to comment.