forked from snychka/python-decoding-sensor-data
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathhouse_info.py
More file actions
21 lines (18 loc) · 674 Bytes
/
house_info.py
File metadata and controls
21 lines (18 loc) · 674 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
from datetime import date
class HouseInfo:
def __init__(self, data):
self.data = data
def get_data_by_area(self, field, rec_area = 0):
field_data = []
for record in self.data:
if rec_area == 0:
field_data.append(record[field])
elif rec_area == int(record['area']):
field_data.append(record[field])
return field_data
def get_data_by_date(self, field, rec_date = date.today()):
field_data = []
for record in self.data:
if rec_date.strftime("%m/%d/%y") == record['date']:
field_data.append(record[field])
return field_data