#NEWLINE# def parse_json( self , json ) : #NEWLINE# #INDENT# self . doi = DOI ( json . get ( 'URL' , None ) ) #NEWLINE# self . score = float ( json . get ( 'score' , 0.0 ) ) #NEWLINE# try : #NEWLINE# #INDENT# self . title = self . format_title ( json [ 'title' ] [ 0 ] ) #NEWLINE# #UNINDENT# except ( IndexError , KeyError ) : #NEWLINE# #INDENT# self . title = self . UNKNOWN_TITLE #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . year = int ( json [ 'issued' ] [ 'date-parts' ] [ 0 ] [ 0 ] ) #NEWLINE# #UNINDENT# except ( TypeError , KeyError , IndexError ) : #NEWLINE# #INDENT# self . year = json . UNKNOWN_YEAR #NEWLINE# #UNINDENT# try : #NEWLINE# #INDENT# self . authors = self . __format_authors ( json [ 'author' ] ) #NEWLINE# #UNINDENT# except KeyError : #NEWLINE# #INDENT# self . authors = self . UNKNOWN_AUTHORS #NEWLINE# #UNINDENT# self . type = json . get ( 'type' , None ) #NEWLINE# self . publisher = json . get ( 'publisher' , None ) #NEWLINE# self . url = json . get ( 'URL' , None )