forked from CS410Assignments/CourseProject
-
Notifications
You must be signed in to change notification settings - Fork 1
/
events.py
43 lines (32 loc) · 1.12 KB
/
events.py
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
import numpy as np
import csv
class Event:
def __init__(self, eventName, eventDate, eventTime, eventVenue, eventCity, eventDescription, eventTags, user, url):
self.eventName = eventName
self.eventDate = eventDate
self.eventTime = eventTime
self.eventVenue = eventVenue
self.eventCity = eventCity
self.eventDescription = eventDescription
self.eventTags = eventTags
self.user = user
self.url = url
self.id = ""
class EventCollection:
def __init__(self, path):
self.eventList = []
self.path = path
def readData(self):
with open(self.path, 'r') as f:
reader = csv.reader(f)
for row in reader:
self.eventList.append(Event(row[2], row[3], row[4], row[5], row[0], row[6], row[8], row[7], row[1]))
'''
USAGE shown below
'''
# file_path = "Eventbrite_data.csv"
# collection = EventCollection(file_path)
# collection.readEventbriteData()
# print(collection.eventList[7].eventName)
# print(collection.eventList[7].eventDate)
# print(collection.eventList[7].eventDescription)