summaryrefslogtreecommitdiff
path: root/wikifolio/model.py
diff options
context:
space:
mode:
authorYves Fischer <yvesf-git@xapek.org>2016-03-01 23:34:05 +0100
committerYves Fischer <yvesf-git@xapek.org>2016-03-01 23:34:05 +0100
commit413051037749da90f03055bcd305c82b1ee90afd (patch)
treedb3df6acc3037eb6a8e02e6345908f7b94c3cb33 /wikifolio/model.py
parent31ec72ec239656655c3c1bab84efcca01b7fdd6c (diff)
downloadwikifolio-rss-413051037749da90f03055bcd305c82b1ee90afd.tar.gz
wikifolio-rss-413051037749da90f03055bcd305c82b1ee90afd.zip
Add script to read trades
Diffstat (limited to 'wikifolio/model.py')
-rw-r--r--wikifolio/model.py27
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())))