示例#1
0
 def root(self):
     root = Element('INVBAL')
     SubElement(root, 'AVAILCASH').text = '12345.67'
     SubElement(root, 'MARGINBALANCE').text = '23456.78'
     SubElement(root, 'SHORTBALANCE').text = '34567.89'
     SubElement(root, 'BUYPOWER').text = '45678.90'
     return root
示例#2
0
 def root(self):
     root = Element('BANKACCTFROM')
     SubElement(root, 'BANKID').text = '111000614'
     SubElement(root, 'BRANCHID').text = '11223344'
     SubElement(root, 'ACCTID').text = '123456789123456789'
     SubElement(root, 'ACCTTYPE').text = 'CHECKING'
     SubElement(root, 'ACCTKEY').text = 'DEADBEEF'
     return root
示例#3
0
 def testExtraElement(self):
     """
     Adding an extra Element not in the spec makes Aggregate.__init__()
     throw a ValueError.
     """
     root = self.root.copy()
     SubElement(root, 'FAKEELEMENT').text = 'garbage'
     with self.assertRaises(ValueError):
         Aggregate.from_etree(root)
示例#4
0
 def root(self):
     root = Element('BAL')
     SubElement(root, 'NAME').text = 'PETTYCASH'
     SubElement(root, 'DESC').text = 'Walking around money'
     SubElement(root, 'BALTYPE').text = 'DOLLAR'
     SubElement(root, 'VALUE').text = '1234567.89'
     SubElement(root, 'DTASOF').text = '20140615'
     currency = SubElement(root, 'CURRENCY')
     SubElement(currency, 'CURSYM').text = 'USD'
     SubElement(currency, 'CURRATE').text = '1.57'
     return root
示例#5
0
 def root(self):
     root = Element('STOCKINFO')
     secinfo = SubElement(root, 'SECINFO')
     secid = SubElement(secinfo, 'SECID')
     SubElement(secid, 'UNIQUEID').text = '123456789'
     SubElement(secid, 'UNIQUEIDTYPE').text = 'CUSIP'
     SubElement(secinfo, 'SECNAME').text = 'Acme Development, Inc.'
     SubElement(secinfo, 'TICKER').text = 'ACME'
     SubElement(secinfo, 'FIID').text = 'AC.ME'
     SubElement(secinfo, 'RATING').text = 'Aa'
     SubElement(secinfo, 'UNITPRICE').text = '94.5'
     SubElement(secinfo, 'DTASOF').text = '20130615'
     currency = SubElement(secinfo, 'CURRENCY')
     SubElement(currency, 'CURSYM').text = 'USD'
     SubElement(currency, 'CURRATE').text = '1.45'
     SubElement(secinfo, 'MEMO').text = 'Foobar'
     SubElement(root, 'STOCKTYPE').text = 'CONVERTIBLE'
     SubElement(root, 'YIELD').text = '5.0'
     SubElement(root, 'DTYIELDASOF').text = '20030501'
     SubElement(root, 'ASSETCLASS').text = 'SMALLSTOCK'
     SubElement(root, 'FIASSETCLASS').text = 'FOO'
     return root
示例#6
0
 def root(self):
     root = Element('OTHERINFO')
     secinfo = SubElement(root, 'SECINFO')
     secid = SubElement(secinfo, 'SECID')
     SubElement(secid, 'UNIQUEID').text = '123456789'
     SubElement(secid, 'UNIQUEIDTYPE').text = 'CUSIP'
     SubElement(secinfo, 'SECNAME').text = 'Acme Development, Inc.'
     SubElement(secinfo, 'TICKER').text = 'ACME'
     SubElement(secinfo, 'FIID').text = 'AC.ME'
     SubElement(secinfo, 'RATING').text = 'Aa'
     SubElement(secinfo, 'UNITPRICE').text = '94.5'
     SubElement(secinfo, 'DTASOF').text = '20130615'
     currency = SubElement(secinfo, 'CURRENCY')
     SubElement(currency, 'CURSYM').text = 'USD'
     SubElement(currency, 'CURRATE').text = '1.45'
     SubElement(secinfo, 'MEMO').text = 'Foobar'
     SubElement(root, 'TYPEDESC').text = 'Securitized baseball card pool'
     SubElement(root, 'ASSETCLASS').text = 'SMALLSTOCK'
     SubElement(root, 'FIASSETCLASS').text = 'FOO'
     return root
示例#7
0
 def root(self):
     root = Element('OPTINFO')
     secinfo = SubElement(root, 'SECINFO')
     secid = SubElement(secinfo, 'SECID')
     SubElement(secid, 'UNIQUEID').text = '123456789'
     SubElement(secid, 'UNIQUEIDTYPE').text = 'CUSIP'
     SubElement(secinfo, 'SECNAME').text = 'Acme Development, Inc.'
     SubElement(secinfo, 'TICKER').text = 'ACME'
     SubElement(secinfo, 'FIID').text = 'AC.ME'
     SubElement(secinfo, 'RATING').text = 'Aa'
     SubElement(secinfo, 'UNITPRICE').text = '94.5'
     SubElement(secinfo, 'DTASOF').text = '20130615'
     currency = SubElement(secinfo, 'CURRENCY')
     SubElement(currency, 'CURSYM').text = 'USD'
     SubElement(currency, 'CURRATE').text = '1.45'
     SubElement(secinfo, 'MEMO').text = 'Foobar'
     SubElement(root, 'OPTTYPE').text = 'CALL'
     SubElement(root, 'STRIKEPRICE').text = '25.5'
     SubElement(root, 'DTEXPIRE').text = '20031215'
     SubElement(root, 'SHPERCTRCT').text = '100'
     secid = SubElement(root, 'SECID')
     SubElement(secid, 'UNIQUEID').text = '987654321'
     SubElement(secid, 'UNIQUEIDTYPE').text = 'CUSIP'
     SubElement(root, 'ASSETCLASS').text = 'SMALLSTOCK'
     SubElement(root, 'FIASSETCLASS').text = 'FOO'
     return root
示例#8
0
 def root(self):
     root = Element('MFINFO')
     secinfo = SubElement(root, 'SECINFO')
     secid = SubElement(secinfo, 'SECID')
     SubElement(secid, 'UNIQUEID').text = '123456789'
     SubElement(secid, 'UNIQUEIDTYPE').text = 'CUSIP'
     SubElement(secinfo, 'SECNAME').text = 'Acme Development, Inc.'
     SubElement(secinfo, 'TICKER').text = 'ACME'
     SubElement(secinfo, 'FIID').text = 'AC.ME'
     SubElement(secinfo, 'RATING').text = 'Aa'
     SubElement(secinfo, 'UNITPRICE').text = '94.5'
     SubElement(secinfo, 'DTASOF').text = '20130615'
     currency = SubElement(secinfo, 'CURRENCY')
     SubElement(currency, 'CURSYM').text = 'USD'
     SubElement(currency, 'CURRATE').text = '1.45'
     SubElement(secinfo, 'MEMO').text = 'Foobar'
     SubElement(root, 'YIELD').text = '5.0'
     SubElement(root, 'DTYIELDASOF').text = '20030501'
     mfassetclass = SubElement(root, 'MFASSETCLASS')
     portion = SubElement(mfassetclass, 'PORTION')
     SubElement(portion, 'ASSETCLASS').text = 'DOMESTICBOND'
     SubElement(portion, 'PERCENT').text = '15'
     portion = SubElement(mfassetclass, 'PORTION')
     SubElement(portion, 'ASSETCLASS').text = 'INTLBOND'
     SubElement(portion, 'PERCENT').text = '15'
     portion = SubElement(mfassetclass, 'PORTION')
     SubElement(portion, 'ASSETCLASS').text = 'LARGESTOCK'
     SubElement(portion, 'PERCENT').text = '15'
     portion = SubElement(mfassetclass, 'PORTION')
     SubElement(portion, 'ASSETCLASS').text = 'SMALLSTOCK'
     SubElement(portion, 'PERCENT').text = '15'
     portion = SubElement(mfassetclass, 'PORTION')
     SubElement(portion, 'ASSETCLASS').text = 'INTLSTOCK'
     SubElement(portion, 'PERCENT').text = '15'
     portion = SubElement(mfassetclass, 'PORTION')
     SubElement(portion, 'ASSETCLASS').text = 'MONEYMRKT'
     SubElement(portion, 'PERCENT').text = '15'
     portion = SubElement(mfassetclass, 'PORTION')
     SubElement(portion, 'ASSETCLASS').text = 'OTHER'
     SubElement(portion, 'PERCENT').text = '10'
     fimfassetclass = SubElement(root, 'FIMFASSETCLASS')
     portion = SubElement(fimfassetclass, 'FIPORTION')
     SubElement(portion, 'FIASSETCLASS').text = 'FOO'
     SubElement(portion, 'PERCENT').text = '50'
     portion = SubElement(fimfassetclass, 'FIPORTION')
     SubElement(portion, 'FIASSETCLASS').text = 'BAR'
     SubElement(portion, 'PERCENT').text = '50'
     return root
示例#9
0
 def root(self):
     root = Element('DEBTINFO')
     secinfo = SubElement(root, 'SECINFO')
     secid = SubElement(secinfo, 'SECID')
     SubElement(secid, 'UNIQUEID').text = '123456789'
     SubElement(secid, 'UNIQUEIDTYPE').text = 'CUSIP'
     SubElement(secinfo, 'SECNAME').text = 'Acme Development, Inc.'
     SubElement(secinfo, 'TICKER').text = 'ACME'
     SubElement(secinfo, 'FIID').text = 'AC.ME'
     SubElement(secinfo, 'RATING').text = 'Aa'
     SubElement(secinfo, 'UNITPRICE').text = '94.5'
     SubElement(secinfo, 'DTASOF').text = '20130615'
     currency = SubElement(secinfo, 'CURRENCY')
     SubElement(currency, 'CURSYM').text = 'USD'
     SubElement(currency, 'CURRATE').text = '1.45'
     SubElement(secinfo, 'MEMO').text = 'Foobar'
     SubElement(root, 'PARVALUE').text = '1000'
     SubElement(root, 'DEBTTYPE').text = 'COUPON'
     SubElement(root, 'DEBTCLASS').text = 'CORPORATE'
     SubElement(root, 'COUPONRT').text = '5.125'
     SubElement(root, 'DTCOUPON').text = '20031201'
     SubElement(root, 'COUPONFREQ').text = 'QUARTERLY'
     SubElement(root, 'CALLPRICE').text = '1000'
     SubElement(root, 'YIELDTOCALL').text = '6.5'
     SubElement(root, 'DTCALL').text = '20051215'
     SubElement(root, 'CALLTYPE').text = 'CALL'
     SubElement(root, 'YIELDTOMAT').text = '6.0'
     SubElement(root, 'DTMAT').text = '20061215'
     SubElement(root, 'ASSETCLASS').text = 'INTLBOND'
     SubElement(root, 'FIASSETCLASS').text = 'Fixed to floating bond'
     return root
示例#10
0
 def root(self):
     root = Element('AVAILBAL')
     SubElement(root, 'BALAMT').text = '12345.67'
     SubElement(root, 'DTASOF').text = '20051029101003'
     return root
示例#11
0
 def root(self):
     root = Element('INVACCTFROM')
     SubElement(root, 'BROKERID').text = '111000614'
     SubElement(root, 'ACCTID').text = '123456789123456789'
     return root
示例#12
0
 def root(self):
     root = Element('CCACCTFROM')
     SubElement(root, 'ACCTID').text = '123456789123456789'
     SubElement(root, 'ACCTKEY').text = 'DEADBEEF'
     return root
示例#13
0
 def root(self):
     root = Element('SONRS')
     status = SubElement(root, 'STATUS')
     SubElement(status, 'CODE').text = '0'
     SubElement(status, 'SEVERITY').text = 'INFO'
     SubElement(root, 'DTSERVER').text = '20051029101003'
     SubElement(root, 'USERKEY').text = 'DEADBEEF'
     SubElement(root, 'TSKEYEXPIRE').text = '20051231'
     SubElement(root, 'LANGUAGE').text = 'ENG'
     SubElement(root, 'DTPROFUP').text = '20050101'
     SubElement(root, 'DTACCTUP').text = '20050102'
     fi = SubElement(root, 'FI')
     SubElement(fi, 'ORG').text = 'NCH'
     SubElement(fi, 'FID').text = '1001'
     SubElement(root, 'SESSCOOKIE').text = 'BADA55'
     SubElement(root, 'ACCESSKEY').text = 'CAFEBABE'
     return root