Skip to content

Commit

Permalink
Blanked out incorrect LPA codes
Browse files Browse the repository at this point in the history
local-authority:BMH missing local-planning-authority value *ignored*
local-authority:CAM has E60000149 but is not an LPA *removed*
local-authority:CHC missing local-planning-authority value *ignored*
local-authority:COR missing local-planning-authority value *ignored*
local-authority:DAV missing local-planning-authority value *ignored*
local-authority:DBY has E60000073 but is not an LPA *removed*
local-authority:EDO missing local-planning-authority value *ignored*
local-authority:ENO missing local-planning-authority value *ignored*
local-authority:FOR missing local-planning-authority value *ignored*
local-authority:GLS has E60000311 but is not an LPA *removed*
local-authority:GMCA has E60000027 but is not an LPA *removed*
local-authority:KET missing local-planning-authority value *ignored*
local-authority:LCR has E60000048 but is not an LPA *removed*
local-authority:LEC has E60000074 but is not an LPA *removed*
local-authority:LIN has E60000094 but is not an LPA *removed*
local-authority:NDO missing local-planning-authority value *ignored*
local-authority:NOR missing local-planning-authority value *ignored*
local-authority:NTT has E60000075 but is not an LPA *removed*
local-authority:OXF has E60000266 but is not an LPA *removed*
local-authority:POL missing local-planning-authority value *ignored*
local-authority:PUR missing local-planning-authority value *ignored*
local-authority:SCR has E60000067 but is not an LPA *removed*
local-authority:SED missing local-planning-authority value *ignored*
local-authority:STS has E60000122 but is not an LPA *removed*
local-authority:SUF missing local-planning-authority value *ignored*
local-authority:TAU missing local-planning-authority value *ignored*
local-authority:WAR has E60000129 but is not an LPA *removed*
local-authority:WDO missing local-planning-authority value *ignored*
local-authority:WEL missing local-planning-authority value *ignored*
local-authority:WEY missing local-planning-authority value *ignored*
local-authority:WOR has E60000140 but is not an LPA *removed*
local-authority:WSO missing local-planning-authority value *ignored*
local-authority:WYCA has E60000056 but is not an LPA *removed*
  • Loading branch information
psd committed Jun 22, 2024
1 parent 51d986f commit 7c58d2a
Show file tree
Hide file tree
Showing 3 changed files with 49 additions and 14 deletions.
35 changes: 35 additions & 0 deletions bin/patch-lpa.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
#!/usr/bin/env python3

import csv
import pandas as pd


# list of LPAs from our role_provision table
lpas = pd.read_csv('https://datasette.planning.data.gov.uk/digital-land/role_organisation.csv?role=local-planning-authority&_labels=on&_size=max')

w = None
r = csv.DictReader(open("data/local-authority.csv"))

for row in r:
if not w:
w = csv.DictWriter(open("local-authority.csv", "w", newline=""), fieldnames=r.fieldnames)
w.writeheader()

if len(lpas.loc[lpas["organisation"] == row["organisation"]]):
if not row["local-planning-authority"]:
print(f'{row["organisation"]} missing local-planning-authority value', end="")
if row["end-date"]:
print(" *ignored*")
else:
print(" *NEED ATTENTION*")
else:
if row["local-planning-authority"]:
print(f'{row["organisation"]} has {row["local-planning-authority"]} but is not an LPA', end="")
if row["local-authority-type"] not in ["CTY", "COMB"]:
print(" *kept*")
else:
print(" *removed*")
row["local-planning-authority"] = ""

w.writerow(row)

Empty file modified bin/patch-region.py
100755 → 100644
Empty file.
Loading

0 comments on commit 7c58d2a

Please sign in to comment.