Skip to content

Commit

Permalink
ND: remove unused voter name identification method
Browse files Browse the repository at this point in the history
  • Loading branch information
jessemortenson committed Oct 24, 2024
1 parent 7ed34ec commit d99e121
Showing 1 changed file with 0 additions and 24 deletions.
24 changes: 0 additions & 24 deletions scrapers/nd/bills.py
Original file line number Diff line number Diff line change
Expand Up @@ -36,30 +36,6 @@ def create_source_url(self):
f"{assembly_session_id}-{year}/data/bills.json"
)

def get_voter_name_from_url(self, url: str) -> str:
"""
Description:
Get the full name from URL
Example:
- https://ndlegis.gov/biography/liz-conmy -> Liz Conmy
- https://ndlegis.gov/biography/randy-a-schobinger -> Randy A. Schobinger
"""
name_uri = (
url.replace("https://ndlegis.gov/biography/", "")
.split("?")[0]
.split("/")[0]
.strip()
)
name_words = [w.title() for w in name_uri.split("-")]
if len(name_words) == 3 and len(name_words[1]) == 1:
return "{0} {1}. {2}".format(*name_words)
elif len(name_words) == 3 and len(name_words[1]) > 1:
return "{0} {1}-{2}".format(*name_words)
else:
return " ".join(name_words)

def get_voter_name_from_url_request(self, url: str) -> str:
"""
Description:
Expand Down

0 comments on commit d99e121

Please sign in to comment.