<s> """<STR_LIT>""" <EOL> __author__ = '<STR_LIT>' <EOL> import atom <EOL> import gdata <EOL> GD_NAMESPACE = '<STR_LIT>' <EOL> GF_NAMESPACE = '<STR_LIT>' <EOL> class Money ( atom . AtomBase ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = GD_NAMESPACE <EOL> _attributes = atom . AtomBase . _attributes . copy ( ) <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> def __init__ ( self , amount = None , currency_code = None , ** kwargs ) : <EOL> self . amount = amount <EOL> self . currency_code = currency_code <EOL> atom . AtomBase . __init__ ( self , ** kwargs ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . amount , self . currency_code ) <EOL> def MoneyFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( Money , xml_string ) <EOL> class _Monies ( atom . AtomBase ) : <EOL> """<STR_LIT>""" <EOL> _namespace = GF_NAMESPACE <EOL> _children = atom . AtomBase . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % GD_NAMESPACE ] = ( '<STR_LIT>' , [ Money ] ) <EOL> def __init__ ( self , money = None , ** kwargs ) : <EOL> self . money = money or [ ] <EOL> atom . AtomBase . __init__ ( self , ** kwargs ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" . join ( [ "<STR_LIT:%s>" % i for i in self . money ] ) <EOL> class CostBasis ( _Monies ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> def CostBasisFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( CostBasis , xml_string ) <EOL> class DaysGain ( _Monies ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> def DaysGainFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( DaysGain , xml_string ) <EOL> class Gain ( _Monies ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> def GainFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( Gain , xml_string ) <EOL> class MarketValue ( _Monies ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _tag = '<STR_LIT>' <EOL> def MarketValueFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( MarketValue , xml_string ) <EOL> class Commission ( _Monies ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> def CommissionFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( Commission , xml_string ) <EOL> class Price ( _Monies ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> def PriceFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( Price , xml_string ) <EOL> class Symbol ( atom . AtomBase ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = GF_NAMESPACE <EOL> _attributes = atom . AtomBase . _attributes . copy ( ) <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> def __init__ ( self , full_name = None , exchange = None , symbol = None , ** kwargs ) : <EOL> self . full_name = full_name <EOL> self . exchange = exchange <EOL> self . symbol = symbol <EOL> atom . AtomBase . __init__ ( self , ** kwargs ) <EOL> def __str__ ( self ) : <EOL> return "<STR_LIT>" % ( self . exchange , self . symbol , self . full_name ) <EOL> def SymbolFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( Symbol , xml_string ) <EOL> class TransactionData ( atom . AtomBase ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = GF_NAMESPACE <EOL> _attributes = atom . AtomBase . _attributes . copy ( ) <EOL> _attributes [ '<STR_LIT:type>' ] = '<STR_LIT:type>' <EOL> _attributes [ '<STR_LIT:date>' ] = '<STR_LIT:date>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _children = atom . AtomBase . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , Commission ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , Price ) <EOL> def __init__ ( self , type = None , date = None , shares = None , <EOL> notes = None , commission = None , price = None , ** kwargs ) : <EOL> self . type = type <EOL> self . date = date <EOL> self . shares = shares <EOL> self . notes = notes <EOL> self . commission = commission <EOL> self . price = price <EOL> atom . AtomBase . __init__ ( self , ** kwargs ) <EOL> def TransactionDataFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( TransactionData , xml_string ) <EOL> class TransactionEntry ( gdata . GDataEntry ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = atom . ATOM_NAMESPACE <EOL> _children = gdata . GDataEntry . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( <EOL> '<STR_LIT>' , TransactionData ) <EOL> def __init__ ( self , transaction_data = None , ** kwargs ) : <EOL> self . transaction_data = transaction_data <EOL> gdata . GDataEntry . __init__ ( self , ** kwargs ) <EOL> def transaction_id ( self ) : <EOL> return self . id . text . split ( "<STR_LIT:/>" ) [ - <NUM_LIT:1> ] <EOL> transaction_id = property ( transaction_id , doc = '<STR_LIT>' ) <EOL> def TransactionEntryFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( TransactionEntry , xml_string ) <EOL> class TransactionFeed ( gdata . GDataFeed ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = atom . ATOM_NAMESPACE <EOL> _children = gdata . GDataFeed . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % atom . ATOM_NAMESPACE ] = ( '<STR_LIT>' , [ TransactionEntry ] ) <EOL> def TransactionFeedFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( TransactionFeed , xml_string ) <EOL> class TransactionFeedLink ( atom . AtomBase ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = GD_NAMESPACE <EOL> _attributes = atom . AtomBase . _attributes . copy ( ) <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _children = atom . AtomBase . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % atom . ATOM_NAMESPACE ] = ( <EOL> '<STR_LIT>' , TransactionFeed ) <EOL> def __init__ ( self , href = None , feed = None , ** kwargs ) : <EOL> self . href = href <EOL> self . feed = feed <EOL> atom . AtomBase . __init__ ( self , ** kwargs ) <EOL> class PositionData ( atom . AtomBase ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = GF_NAMESPACE <EOL> _attributes = atom . AtomBase . _attributes . copy ( ) <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _children = atom . AtomBase . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , CostBasis ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , DaysGain ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , Gain ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , MarketValue ) <EOL> def __init__ ( self , gain_percentage = None , <EOL> return1w = None , return4w = None , return3m = None , returnYTD = None , <EOL> return1y = None , return3y = None , return5y = None , return_overall = None , <EOL> shares = None , cost_basis = None , days_gain = None , <EOL> gain = None , market_value = None , ** kwargs ) : <EOL> self . gain_percentage = gain_percentage <EOL> self . return1w = return1w <EOL> self . return4w = return4w <EOL> self . return3m = return3m <EOL> self . returnYTD = returnYTD <EOL> self . return1y = return1y <EOL> self . return3y = return3y <EOL> self . return5y = return5y <EOL> self . return_overall = return_overall <EOL> self . shares = shares <EOL> self . cost_basis = cost_basis <EOL> self . days_gain = days_gain <EOL> self . gain = gain <EOL> self . market_value = market_value <EOL> atom . AtomBase . __init__ ( self , ** kwargs ) <EOL> def PositionDataFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( PositionData , xml_string ) <EOL> class PositionEntry ( gdata . GDataEntry ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = atom . ATOM_NAMESPACE <EOL> _children = gdata . GDataEntry . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( <EOL> '<STR_LIT>' , PositionData ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , Symbol ) <EOL> _children [ '<STR_LIT>' % GD_NAMESPACE ] = ( <EOL> '<STR_LIT>' , TransactionFeedLink ) <EOL> def __init__ ( self , position_data = None , symbol = None , feed_link = None , <EOL> ** kwargs ) : <EOL> self . position_data = position_data <EOL> self . symbol = symbol <EOL> self . feed_link = feed_link <EOL> gdata . GDataEntry . __init__ ( self , ** kwargs ) <EOL> def position_title ( self ) : <EOL> return self . title . text <EOL> position_title = property ( position_title , <EOL> doc = '<STR_LIT>' ) <EOL> def ticker_id ( self ) : <EOL> return self . id . text . split ( "<STR_LIT:/>" ) [ - <NUM_LIT:1> ] <EOL> ticker_id = property ( ticker_id , doc = '<STR_LIT>' ) <EOL> def transactions ( self ) : <EOL> if self . feed_link . feed : <EOL> return self . feed_link . feed . entry <EOL> else : <EOL> return None <EOL> transactions = property ( transactions , doc = """<STR_LIT>""" ) <EOL> def PositionEntryFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( PositionEntry , xml_string ) <EOL> class PositionFeed ( gdata . GDataFeed ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = atom . ATOM_NAMESPACE <EOL> _children = gdata . GDataFeed . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % atom . ATOM_NAMESPACE ] = ( '<STR_LIT>' , [ PositionEntry ] ) <EOL> def PositionFeedFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( PositionFeed , xml_string ) <EOL> class PositionFeedLink ( atom . AtomBase ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = GD_NAMESPACE <EOL> _attributes = atom . AtomBase . _attributes . copy ( ) <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _children = atom . AtomBase . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % atom . ATOM_NAMESPACE ] = ( <EOL> '<STR_LIT>' , PositionFeed ) <EOL> def __init__ ( self , href = None , feed = None , ** kwargs ) : <EOL> self . href = href <EOL> self . feed = feed <EOL> atom . AtomBase . __init__ ( self , ** kwargs ) <EOL> class PortfolioData ( atom . AtomBase ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = GF_NAMESPACE <EOL> _attributes = atom . AtomBase . _attributes . copy ( ) <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _attributes [ '<STR_LIT>' ] = '<STR_LIT>' <EOL> _children = atom . AtomBase . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , CostBasis ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , DaysGain ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , Gain ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( '<STR_LIT>' , MarketValue ) <EOL> def __init__ ( self , currency_code = None , gain_percentage = None , <EOL> return1w = None , return4w = None , return3m = None , returnYTD = None , <EOL> return1y = None , return3y = None , return5y = None , return_overall = None , <EOL> cost_basis = None , days_gain = None , gain = None , market_value = None , ** kwargs ) : <EOL> self . currency_code = currency_code <EOL> self . gain_percentage = gain_percentage <EOL> self . return1w = return1w <EOL> self . return4w = return4w <EOL> self . return3m = return3m <EOL> self . returnYTD = returnYTD <EOL> self . return1y = return1y <EOL> self . return3y = return3y <EOL> self . return5y = return5y <EOL> self . return_overall = return_overall <EOL> self . cost_basis = cost_basis <EOL> self . days_gain = days_gain <EOL> self . gain = gain <EOL> self . market_value = market_value <EOL> atom . AtomBase . __init__ ( self , ** kwargs ) <EOL> def PortfolioDataFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( PortfolioData , xml_string ) <EOL> class PortfolioEntry ( gdata . GDataEntry ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = atom . ATOM_NAMESPACE <EOL> _children = gdata . GDataEntry . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % GF_NAMESPACE ] = ( <EOL> '<STR_LIT>' , PortfolioData ) <EOL> _children [ '<STR_LIT>' % GD_NAMESPACE ] = ( <EOL> '<STR_LIT>' , PositionFeedLink ) <EOL> def __init__ ( self , portfolio_data = None , feed_link = None , ** kwargs ) : <EOL> self . portfolio_data = portfolio_data <EOL> self . feed_link = feed_link <EOL> gdata . GDataEntry . __init__ ( self , ** kwargs ) <EOL> def portfolio_title ( self ) : <EOL> return self . title . text <EOL> def set_portfolio_title ( self , portfolio_title ) : <EOL> self . title = atom . Title ( text = portfolio_title , title_type = '<STR_LIT:text>' ) <EOL> portfolio_title = property ( portfolio_title , set_portfolio_title , <EOL> doc = '<STR_LIT>' ) <EOL> def portfolio_id ( self ) : <EOL> return self . id . text . split ( "<STR_LIT:/>" ) [ - <NUM_LIT:1> ] <EOL> portfolio_id = property ( portfolio_id , <EOL> doc = '<STR_LIT>' ) <EOL> def positions ( self ) : <EOL> if self . feed_link . feed : <EOL> return self . feed_link . feed . entry <EOL> else : <EOL> return None <EOL> positions = property ( positions , doc = """<STR_LIT>""" ) <EOL> def PortfolioEntryFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( PortfolioEntry , xml_string ) <EOL> class PortfolioFeed ( gdata . GDataFeed ) : <EOL> """<STR_LIT>""" <EOL> _tag = '<STR_LIT>' <EOL> _namespace = atom . ATOM_NAMESPACE <EOL> _children = gdata . GDataFeed . _children . copy ( ) <EOL> _children [ '<STR_LIT>' % atom . ATOM_NAMESPACE ] = ( '<STR_LIT>' , [ PortfolioEntry ] ) <EOL> def PortfolioFeedFromString ( xml_string ) : <EOL> return atom . CreateClassFromXMLString ( PortfolioFeed , xml_string ) </s>
