forked from edmundyan/yelp
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathReview.py
More file actions
executable file
·27 lines (21 loc) · 772 Bytes
/
Copy pathReview.py
File metadata and controls
executable file
·27 lines (21 loc) · 772 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
class Review(dict):
def __init__(self, args):
dict.__init__(self, args)
self.remove_keys()
def remove_keys(self):
keep = ['user_id', 'review_id', 'stars', 'business_id']
keys = ['votes', 'date', 'text', 'type']
for key in keys:
del self[key]
# add 'u' and 'b' to end of ids
self['user_id'] += 'u'
self['business_id'] += 'b'
# {
# "user_id": "xAVu2pZ6nIvkdHh8vGs84Q"
# "review_id": "DusrkpkTGPGkqK13xO1TZg"
# "stars": 3
# "date": "2011-11-26"
# "text": "Standard Chipotle fare - consistently good; not bad for corporate food - if you have a few minutes
# there are a number of good local offerings within walking distance."
# "type": "review"
# "business_id": "WcGTSRku3mrVK7V9GKq4UQ"}