Skip to content

Instantly share code, notes, and snippets.

@atdt
Created March 13, 2024 21:12
Show Gist options
  • Save atdt/335bf05d753e39c8ebc7fe49f80a92e2 to your computer and use it in GitHub Desktop.
Save atdt/335bf05d753e39c8ebc7fe49f80a92e2 to your computer and use it in GitHub Desktop.
Supervocalic restaurants in NYC
GRAIN HOUSE
VILLAS LOUNGE 2 CORP
BOQUERIA
OM JUICE BAR
Tout va bien
BLACK IRON BURGER
Grain House
44 South Village
HARMONIE CLUB
Uncle Tony's Pizza
VILLAS LOUNGE 2
STITCH Bar & Lounge
Anytime Soju INC
Great Burrito
Boqueria
Cocina Del Sur
Souvlaki GR LES
Sophie's Cuban
import csv
# NYC restaurants:
# https://data.cityofnewyork.us/Transportation/Open-Restaurants-Inspections/4dx7-axux/about_data
def sanitize_name(name):
name = ''.join(c for c in name.lower() if c.isalpha() or c == ' ')
return ' '.join(word for word in name.split() if word not in ('corp', 'inc'))
def is_supervocalic(phrase):
return all(phrase.count(vowel) == 1 for vowel in 'aeiou')
with open('Open_Restaurants_Inspections_20240313.csv', newline='') as csvfile:
reader = csv.DictReader(csvfile)
restaurants = {row['RestaurantName'] for row in reader if row['Borough'] == 'Manhattan'}
for restaurant in restaurants:
if is_supervocalic(sanitize_name(restaurant)):
print(restaurant)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment