-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinspection.py
More file actions
44 lines (41 loc) · 1.25 KB
/
inspection.py
File metadata and controls
44 lines (41 loc) · 1.25 KB
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
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
import typing
class Inspection:
def __init__(
self,
restaurant_id,
restaurant_name,
borough,
zipcode,
cuisine,
inspection_date,
violation_code,
violation_description,
score,
grade,
grade_date,
):
self.restaurant_id = restaurant_id
self.restaurant_name = restaurant_name
self.borough = borough
self.zipcode = zipcode
self.cuisine = cuisine
self.inspection_date = inspection_date
self.violation_code = violation_code
self.violation_description = violation_description
self.score = score
self.grade = grade
self.grade_date = grade_date
def to_json(self) -> typing.Dict:
return {
"restaurant_id": self.restaurant_id,
"restaurant_name": self.restaurant_name,
"borough": self.borough,
"zipcode": self.zipcode,
"cuisine": self.cuisine,
"inspection_date": self.inspection_date,
"violation_code": self.violation_code,
"violation_description": self.violation_description,
"score": self.score,
"grade": self.grade,
"grade_date": self.grade_date,
}