diff options
Diffstat (limited to 'wikifolio/model.py')
-rw-r--r-- | wikifolio/model.py | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/wikifolio/model.py b/wikifolio/model.py index 7315782..ce8feba 100644 --- a/wikifolio/model.py +++ b/wikifolio/model.py @@ -2,9 +2,10 @@ BASE_URL = "https://www.wikifolio.com/de/de/wikifolio/" class Certificate: - def __init__(self, id, shortdesc, isin, trader): - self.id = id - self.name = shortdesc + def __init__(self, name, guid, shortdesc, isin, trader): + self.name = name + self.guid = guid + self.shortdesc = shortdesc self.isin = isin self.trader = trader @@ -13,7 +14,7 @@ class Certificate: def __repr__(self): return "<{} id={} shortdesc=\"{}\" isin={}>".format( - self.__class__.__name__, self.id, self.name, self.isin) + self.__class__.__name__, self.guid, self.name, self.isin) class Comment: @@ -23,3 +24,21 @@ class Comment: self.description = text self.guid = guid self.link = link + + +class Trade: + TYPE_KAUF = 'Quote Kauf' + TYPE_VERKAUF = 'Quote Verkauf' + + def __init__(self, share_name, share_isin, typ, status, timestamp, quote, volume): + self.share_name = share_name + self.share_isin = share_isin + self.typ = typ + self.status = status + self.timestamp = timestamp + self.quote = quote + self.volume = volume + + def __repr__(self): + return "<{} {}".format(type(self).__name__, + " ".join(map(lambda kv: "{}={}".format(*kv), self.__dict__.items()))) |