From 413051037749da90f03055bcd305c82b1ee90afd Mon Sep 17 00:00:00 2001 From: Yves Fischer Date: Tue, 1 Mar 2016 23:34:05 +0100 Subject: Add script to read trades --- wikifolio/model.py | 27 +++++++++++++++++++++++---- 1 file changed, 23 insertions(+), 4 deletions(-) (limited to 'wikifolio/model.py') 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()))) -- cgit v1.2.1