-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathWatchTimestamp.py
More file actions
27 lines (22 loc) · 828 Bytes
/
WatchTimestamp.py
File metadata and controls
27 lines (22 loc) · 828 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
from datetime import datetime
class WatchTimestamp:
def __init__(self, currency: str, offers_count: int, price_stats: object):
self.timestamp = datetime.now()
self.currency = currency
self.offers_count = offers_count
self.p_mean = price_stats["p_mean"]
self.p_med = price_stats["p_med"]
self.p_lowest = price_stats["p_lowest"]
self.p_highest = price_stats["p_highest"]
def pushable(self):
return {
"timestamp": self.timestamp,
"currency": self.currency,
"offers_count": self.offers_count ,
"p_mean": self.p_mean ,
"p_med": self.p_med,
"p_lowest": self.p_lowest,
"p_highest": self.p_highest
}
def __str__(self):
return self.pushable().__str__()