← back to La Permits School
Harden contractor parser: bound name on field delimiter + optional license -> 461/461 (100%) resolved; fixes 5 dropped owner-builder permits (Cody QA catch)
fc3eeb85d1f3d51f4b7280260611afcfabac1b05 · 2026-08-10 15:14:45 -0700 · Steve Abrams
Files touched
M enrich_live_contractor.pyM master_live.csv
Diff
commit fc3eeb85d1f3d51f4b7280260611afcfabac1b05
Author: Steve Abrams <steve@designerwallcoverings.com>
Date: Mon Aug 10 15:14:45 2026 -0700
Harden contractor parser: bound name on field delimiter + optional license -> 461/461 (100%) resolved; fixes 5 dropped owner-builder permits (Cody QA catch)
---
enrich_live_contractor.py | 21 ++++++++++++---------
master_live.csv | 10 +++++-----
2 files changed, 17 insertions(+), 14 deletions(-)
diff --git a/enrich_live_contractor.py b/enrich_live_contractor.py
index 9fbbdd4..55e8c90 100644
--- a/enrich_live_contractor.py
+++ b/enrich_live_contractor.py
@@ -33,8 +33,10 @@ CACHE = ".ladbs_detail_cache.json"
CA_SOS = "https://bizfileonline.sos.ca.gov/search/business"
CSLB = "https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx"
-# "Contractor Pcl Construction Services Inc; Lic. No.: 474555-B 655 N CENTRAL ..."
-RE_CONTRACTOR = re.compile(r"Contractor\s+(.+?);\s*Lic\.?\s*No\.?:\s*([A-Za-z0-9\-]+)", re.I)
+# Name ends at the first field delimiter: ";" (licensed GC) OR ", Inspector"/"Inspector
+# Information"/", Owner" (owner-builder permits carry NO "; Lic. No.:" after the name).
+RE_NAME = re.compile(r"Contractor\s+(.{2,90}?)\s*(?:;|,?\s*Inspector\b|,\s*Owner\b)", re.I)
+RE_LIC = re.compile(r"Lic\.?\s*No\.?:\s*([A-Za-z0-9\-]+)", re.I)
def load_cache():
@@ -70,17 +72,18 @@ def fetch_detail(seg1, seg2, seg3):
def parse_contractor(html):
- t = _html.unescape(flatten(html)) # decode ' & etc.
- t = re.sub(r"\s+", " ", t)
- m = RE_CONTRACTOR.search(t)
+ t = re.sub(r"\s+", " ", _html.unescape(flatten(html))) # decode ' &
+ m = RE_NAME.search(t)
if not m:
return "", ""
name = re.sub(r"\s+", " ", m.group(1)).strip(" .,")
- lic = m.group(2).strip()
- # owner self-permitted: report "Owner-Builder", drop the mashed-in engineer text
+ # owner self-permitted: report "Owner-Builder", no contractor license
if name.lower().startswith("owner-builder"):
- name, lic = "Owner-Builder", ""
- return name, lic
+ return "Owner-Builder", ""
+ # license lives in the ~60 chars right after the name (the GC's "; Lic. No.: <n>")
+ tail = t[m.end() - 1: m.end() + 60]
+ lm = RE_LIC.search(tail)
+ return name, (lm.group(1).strip() if lm else "")
def sos_url(name):
diff --git a/master_live.csv b/master_live.csv
index 21e3e8d..9b119ae 100644
--- a/master_live.csv
+++ b/master_live.csv
@@ -49,7 +49,7 @@ permit_nbr,issue_date,status_desc,permit_type,permit_sub_type,use_desc,valuation
25010-10000-03663,2026-05-01,Issued,Bldg-New,Apartment,Apartment,10700000,54426,1035 S CRENSHAW BLVD 1-70,90019,10,5082027028,https://portal.assessor.lacounty.gov/parceldetail/5082027028,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Wilshire Construction L P,1048091-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Wilshire+Construction+L+P,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=1048091-B,2026-05-01
22014-10000-06157,2026-06-05,Issued,Bldg-Addition,Apartment,Apartment,10000000,47033,2201 E 1ST ST 1-80,90033,14,5183005048,https://portal.assessor.lacounty.gov/parceldetail/5183005048,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Alpha Construction Co Inc,241368-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Alpha+Construction+Co+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=241368-B,2026-06-05
24010-10000-03597,2026-03-17,Issued,Bldg-New,Commercial,Miscellaneous Bldg/Structure,10000000,2883,9863 S SEPULVEDA BLVD,90045,11,4117034901,https://portal.assessor.lacounty.gov/parceldetail/4117034901,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Skanska Usa Civil West California District Inc,140069-A,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Skanska+Usa+Civil+West+California+District+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=140069-A,2026-03-17
-21010-10000-06758,2026-02-27,Issued,Bldg-New,Apartment,Apartment,9500000,52243,11939 W MAYFIELD AVE #1-28,90049,11,4265009060,https://portal.assessor.lacounty.gov/parceldetail/4265009060,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-02-27
+21010-10000-06758,2026-02-27,Issued,Bldg-New,Apartment,Apartment,9500000,52243,11939 W MAYFIELD AVE #1-28,90049,11,4265009060,https://portal.assessor.lacounty.gov/parceldetail/4265009060,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-02-27
22010-10000-04734,2026-03-05,Issued,Bldg-New,Apartment,Apartment,9500000,38499,1537 S HAYWORTH AVE 1-30,90035,10,5068018022,https://portal.assessor.lacounty.gov/parceldetail/5068018022,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Owner-Builder,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-03-05
22014-10000-06155,2026-05-15,Issued,Bldg-Addition,Commercial,Cold Storage Plant,9500000,45864,1420 N COIL AVE,90744,15,7426029007,https://portal.assessor.lacounty.gov/parceldetail/7426029007,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Alston Construction Company Inc,759899-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Alston+Construction+Company+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=759899-B,2026-05-15
23010-10000-01915,2025-10-09,Issued,Bldg-New,Commercial,Warehouse,9103500,143688,1515 W 190TH ST,90248,15,7351001023,https://portal.assessor.lacounty.gov/parceldetail/7351001023,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Norm Wilson & Sons Inc,435700-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Norm+Wilson+%26+Sons+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=435700-B,2025-10-09
@@ -274,7 +274,7 @@ permit_nbr,issue_date,status_desc,permit_type,permit_sub_type,use_desc,valuation
23010-10000-02967,2025-09-26,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1860000,11122.5,9994 W BARLING ST,91040,7,2543021003,https://portal.assessor.lacounty.gov/parceldetail/2543021003,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Owner-Builder,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2025-09-26
25010-10000-03134,2025-08-29,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1800000,4751.8,645 N HAVERFORD AVE,90272,11,4412014045,https://portal.assessor.lacounty.gov/parceldetail/4412014045,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Wilshire Construction L P,1048091-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Wilshire+Construction+L+P,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=1048091-B,2025-08-29
25010-10000-03017,2025-12-05,CofO Issued,Bldg-New,Commercial,School Building,1800000,2064,18618 W LANARK ST,91335,4,2103009050,https://portal.assessor.lacounty.gov/parceldetail/2103009050,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Del Amo Construction Llc,744458-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Del+Amo+Construction+Llc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=744458-B,2025-12-05
-25010-10000-04308,2026-01-02,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1800000,5705,15254 W EARLHAM ST,90272,11,4412021009,https://portal.assessor.lacounty.gov/parceldetail/4412021009,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-01-02
+25010-10000-04308,2026-01-02,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1800000,5705,15254 W EARLHAM ST,90272,11,4412021009,https://portal.assessor.lacounty.gov/parceldetail/4412021009,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-01-02
24010-10000-02759,2025-10-10,Issued,Bldg-New,Apartment,Apartment,1800000,9642,7407 S BROADWAY 1-21,90003,9,6031009017,https://portal.assessor.lacounty.gov/parceldetail/6031009017,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Owner-Builder,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2025-10-10
26010-30000-00718,2026-04-24,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1800000,3942.39,1191 N LACHMAN LANE,90272,11,4420024041,https://portal.assessor.lacounty.gov/parceldetail/4420024041,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Jermain And Sun Co,363168-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Jermain+And+Sun+Co,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=363168-B,2026-04-24
25010-30000-03333,2025-09-30,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1800000,3321,756 N JACON WAY,90272,11,4419006020,https://portal.assessor.lacounty.gov/parceldetail/4419006020,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Pacific Image Builders Inc,804559-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Pacific+Image+Builders+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=804559-B,2025-09-30
@@ -426,7 +426,7 @@ permit_nbr,issue_date,status_desc,permit_type,permit_sub_type,use_desc,valuation
25010-10000-00948,2025-10-16,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1180000,5064,3841-3843 N DIXIE CANYON AVE,91423,4,2373028006,https://portal.assessor.lacounty.gov/parceldetail/2373028006,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Grossman Construction & Development Inc,1052191-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Grossman+Construction+%26+Development+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=1052191-B,2025-10-16
23010-30000-02872,2025-09-16,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1175000,7252,1733 N DOHENY DR,90069,4,5561007009,https://portal.assessor.lacounty.gov/parceldetail/5561007009,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,James Roman Design Build Inc,953964-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=James+Roman+Design+Build+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=953964-B,2025-09-16
26010-30000-01168,2026-06-10,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1175000,5047,736 N VIA DE LA PAZ,90272,11,4412008004,https://portal.assessor.lacounty.gov/parceldetail/4412008004,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Heltzer Development Group Inc,993371-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Heltzer+Development+Group+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=993371-B,2026-06-10
-24010-10000-05219,2026-06-19,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1160016,6951,805-807 S 6TH AVE,90291,11,4239009014,https://portal.assessor.lacounty.gov/parceldetail/4239009014,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-06-19
+24010-10000-05219,2026-06-19,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1160016,6951,805-807 S 6TH AVE,90291,11,4239009014,https://portal.assessor.lacounty.gov/parceldetail/4239009014,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-06-19
22010-10000-02880,2025-10-03,Issued,Bldg-New,Apartment,Apartment,1157650,5027,9200 S FIRTH BLVD 1-6,90002,15,6048003027,https://portal.assessor.lacounty.gov/parceldetail/6048003027,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Marouni Industries Inc,960577-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Marouni+Industries+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=960577-B,2025-10-03
24010-10000-03607,2025-09-17,Issued,Bldg-New,1 or 2 Family Dwelling,Duplex,1156200,8320,4622-4622 1/2 W MELBOURNE AVE,90027,4,5590021007,https://portal.assessor.lacounty.gov/parceldetail/5590021007,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Owner-Builder,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2025-09-17
20014-20000-02731,2026-03-20,Issued,Bldg-Addition,Commercial,Warehouse,1143896,24731,13018 W RAYMER ST,91605,2,2327015014,https://portal.assessor.lacounty.gov/parceldetail/2327015014,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Owner-Builder,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-03-20
@@ -458,5 +458,5 @@ permit_nbr,issue_date,status_desc,permit_type,permit_sub_type,use_desc,valuation
25010-30000-04796,2026-04-17,Issued,Bldg-Addition,1 or 2 Family Dwelling,Dwelling - Single Family,1050000,7390,11776 W CHENAULT ST,90049,11,4401015010,https://portal.assessor.lacounty.gov/parceldetail/4401015010,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Sperling Group Inc,1061452-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Sperling+Group+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=1061452-B,2026-04-17
25010-30000-02807,2026-06-23,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1030000,6568,635 N OCAMPO DR,90272,11,4411012003,https://portal.assessor.lacounty.gov/parceldetail/4411012003,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Sowa Development Inc,961853-B,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Sowa+Development+Inc,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx?LicNum=961853-B,2026-06-23
22010-20000-06176,2026-01-27,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1006000,1445,4260 N CANOGA AVE,91364,3,2172030093,https://portal.assessor.lacounty.gov/parceldetail/2172030093,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,https://bizfileonline.sos.ca.gov/search/business?searchType=BUSINESS&q=Owner-Builder,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-01-27
-22010-20000-06174,2026-01-27,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1006000,1687,4254 N CANOGA AVE,91364,3,2172030093,https://portal.assessor.lacounty.gov/parceldetail/2172030093,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-01-27
-22010-20000-06175,2026-01-27,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1005000,1671,4256 N CANOGA AVE,91364,3,2172030093,https://portal.assessor.lacounty.gov/parceldetail/2172030093,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-01-27
+22010-20000-06174,2026-01-27,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1006000,1687,4254 N CANOGA AVE,91364,3,2172030093,https://portal.assessor.lacounty.gov/parceldetail/2172030093,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-01-27
+22010-20000-06175,2026-01-27,Issued,Bldg-New,1 or 2 Family Dwelling,Dwelling - Single Family,1005000,1671,4256 N CANOGA AVE,91364,3,2172030093,https://portal.assessor.lacounty.gov/parceldetail/2172030093,https://www.ladbsservices2.lacity.org/OnlineServices/OnlineServices/OnlineBuildingRecords,Owner-Builder,,,https://www.cslb.ca.gov/OnlineServices/CheckLicenseII/CheckLicense.aspx,2026-01-27
← 3f94c0e Generate LIVE-BOARD.md + wire live_board/lockfile into run_p
·
back to La Permits School
·
live cycle: refresh permits + contractors, merge master (202 a0e7e79 →