-
Notifications
You must be signed in to change notification settings - Fork 4
/
asset.py
33 lines (27 loc) · 904 Bytes
/
asset.py
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
28
29
30
31
32
33
# -*- coding: utf-8 -*-
from cashflow import *
import uuid
from globals import *
import myLogger
# create logger
module_logger = myLogger.TLogger(__name__)
class Asset(object):
""" The asset class is the superclass from which any financial asset is derived
such as equity, bonds, etc.
It provides a common interface such as a
present value, descriptor and identifier for the object.__class__
>>> ast = Asset()
>>> ast.pv
>>> ast.price
>>> ast.description
'No description given'
"""
def __init__(self, pv = None, description="No description given", price= None):
self.logger = myLogger.TLogger(__name__)
self.pv = pv
self.price = price
self.description = description
self.id = uuid.uuid1()
if __name__ == "__main__":
import doctest
doctest.testmod()