#NEWLINE# def parse_hq_stock_basic( self , response ) : #NEWLINE# #INDENT# json_response = json . loads ( response . body_as_unicode ( ) ) #NEWLINE# item = StockItem ( ) #NEWLINE# symbol = response . meta [ 'symbol' ] #NEWLINE# value = json_response [ symbol ] #NEWLINE# item [ 'symbol' ] = symbol #NEWLINE# item [ 'eps' ] = ( float ( ( value . get ( 'eps' , 0 ) or 0 ) ) or None ) #NEWLINE# item [ 'pe_ttm' ] = ( float ( ( value . get ( 'pe_ttm' , 0 ) or 0 ) ) or None ) #NEWLINE# item [ 'pe_lyr' ] = ( float ( ( value . get ( 'pe_lyr' , 0 ) or 0 ) ) or None ) #NEWLINE# item [ 'net_assets' ] = ( float ( ( value . get ( 'net_assets' , 0 ) or 0 ) ) or None ) #NEWLINE# item [ 'pb' ] = ( float ( ( value . get ( 'pb' , 0 ) or 0 ) ) or None ) #NEWLINE# item [ 'rise_stop' ] = ( float ( ( value . get ( 'rise_stop' , 0 ) or 0 ) ) or None ) #NEWLINE# item [ 'fall_stop' ] = ( float ( ( value . get ( 'fall_stop' , 0 ) or 0 ) ) or None ) #NEWLINE# item [ 'market_capital' ] = ( float ( ( value . get ( 'marketCapital' , 0 ) or 0 ) ) or None ) #NEWLINE# item [ 'exchangeable_market_capital' ] = ( float ( ( value . get ( 'float_market_capital' , 0 ) or 0 ) ) or None ) #NEWLINE# ( yield item )