Created
March 13, 2024 21:12
-
-
Save atdt/335bf05d753e39c8ebc7fe49f80a92e2 to your computer and use it in GitHub Desktop.
Supervocalic restaurants in NYC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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