uniprot/search.py
def extract_info(
                self,
                main_key:str,
                sub_key:str,
                data_key:str,
            ):
        """Will extract info from the response head
        
        Arguments:

            key:str

        """

        extracted_info = {}
        for i in range(len(self.data)):
            try:
                gene_key = self.data[i]['gene'][0]['name']['value']
                if self.data[i][main_key][0]["type"] == sub_key:
                    extracted_info[gene_key] = [self.data[i][main_key][0][data_key]]
                    print("success")
            except KeyError as e:
                print(f"Could not find <{main_key}> and <{sub_key}>\n{e}")
        
        return extracted_info
Will extract info from the response head
        
        Arguments:

            key:str

        
Will extract info from the response head
Will extract info from the response head
def extract_info(
                self,
                main_key:str,
                sub_key:str,
                data_key:str,
            ):
        extracted_info = {}
        for i in range(len(self.data)):
            try:
                gene_key = self.data[i]['gene'][0]['name']['value']
                if self.data[i][main_key][0]["type"] == sub_key:
                    extracted_info[gene_key] = [self.data[i][main_key][0][data_key]]
                    print("success")
            except KeyError as e:
                print(f"Could not find <{main_key}> and <{sub_key}>\n{e}")
        return extracted_info
def extract_info ( self , main_key : str , sub_key : str , data_key : str , ) : extracted_info = { } for i in range ( len ( self . data ) ) : try : gene_key = self . data [ i ] [ 'gene' ] [ 0 ] [ 'name' ] [ 'value' ] if self . data [ i ] [ main_key ] [ 0 ] [ "type" ] == sub_key : extracted_info [ gene_key ] = [ self . data [ i ] [ main_key ] [ 0 ] [ data_key ] ] print ( "success" ) except KeyError as e : print ( f"Could not find <{main_key}> and <{sub_key}>\n{e}" ) return extracted_info
Will extract info from the response head
Will extract info from the response head
"""Will extract info from the response head
        
        Arguments:

            key:str

        """
self
main_key
str
sub_key
str
data_key
str
key
None