Skip to content

Instantly share code, notes, and snippets.

Avatar

Mrinal Mohit mrinal-scio

View GitHub Profile
View gmaps.py
def clean_address(s):
s1 = re.sub(r'^[A-Z0-9]{4}-', '', s) # T-Mobile specific
s2 = re.sub(r'[^\s,a-zA-Z]', ' ', s1) # drop all numbers and non-comma punct
s3 = re.sub('Remote', '', s2) # drop "Remote"
s4 = re.sub(r'\s+', ' ', s3) # normalize whitespace
return s4.lstrip().rstrip()
def get_city_state_country(location):
API_KEY = "API_KEY"
url = f"https://maps.googleapis.com/maps/api/geocode/json?address={location}&key={API_KEY}"
View clean.py
def clean_address(s):
s1 = re.sub(r'^[A-Z0-9]{4}-', '', s) # T-Mobile specific
s2 = re.sub(r'[^\s,a-zA-Z]', ' ', s1) # drop all numbers and non-comma punct
s3 = re.sub('Remote', '', s2) # drop "Remote"
s4 = re.sub(r'\s+', ' ', s3) # normalize whitespace
return s4.lstrip().rstrip()
View clean.py
def clean_address(s):
s1 = re.sub(r'^[A-Z0-9]{4}-', '', s) # T-Mobile specific
s2 = re.sub(r'[^\s,a-zA-Z]', ' ', s1) # drop all numbers and non-comma punct
s3 = re.sub('Remote', '', s2) # drop "Remote"
s4 = re.sub(r'\s+', ' ', s3) # normalize whitespace
return s4.lstrip().rstrip()
View gist:ccd3c9973c3505c0839a65054223473f
def clean_address(s):
s1 = re.sub(r'^[A-Z0-9]{4}-', '', s) # T-Mobile specific
s2 = re.sub(r'[^\s,a-zA-Z]', ' ', s1) # drop all numbers and non-comma punct
s3 = re.sub('Remote', '', s2) # drop "Remote"
s4 = re.sub(r'\s+', ' ', s3) # normalize whitespace
return s4.lstrip().rstrip()
View gist:765ae3e3de8cc4870ba672db41db5c6c
.build
.debug
"/debug"
/debug
/debug/encode
/debug/sim
=term.weight
1d164bc0e
3412008ec517e21ce706777252b91f9989787122
6b4fdf4e2e4b083a5a5666392a6f656c5b4404d7