Dictionary in python

Asked

Viewed 256 times

0

Good morning! I’m having trouble breaking down the information and dictionary in python. My dictionary is a Biopython-generated dictionary like the one below:

{'LastUpdate': '2016/11/11 04:34', 'Count': '26645932', 'DbName': 'pubmed', 'LinkList': [{'Description': 'Assembly', 'Menu': 'Assembly', 'DbTo': 'assembly', 'Name': 'pubmed_assembly'}, {'Description': 'Related Projects', 'Menu': 'Project Links', 'DbTo': 'bioproject', 'Name': 'pubmed_bioproject'}, {'Description': 'BioSample links', 'Menu': 'BioSample Links', 'DbTo': 'biosample', 'Name': 'pubmed_biosample'}, {'Description': 'BioSystems', 'Menu': 'BioSystem Links', 'DbTo': 'biosystems', 'Name': 'pubmed_biosystems'}, {'Description': 'PubMed links associated with Books', 'Menu': 'Cited in Books', 'DbTo': 'books', 'Name': 'pubmed_books_refs'}, {'Description': 'Link to related CDD entry', 'Menu': 'Conserved Domain Links', 'DbTo': 'cdd', 'Name': 'pubmed_cdd'}, {'Description': 'Clinical variations associated with publication', 'Menu': 'ClinVar', 'DbTo': 'clinvar', 'Name': 'pubmed_clinvar'}, {'Description': 'Clinical variations calculated to be associated with publication', 'Menu': 'ClinVar (calculated)', 'DbTo': 'clinvar', 'Name': 'pubmed_clinvar_calculated'}, {'Description': 'Link from PubMed to dbVar', 'Menu': 'dbVar', 'DbTo': 'dbvar', 'Name': 'pubmed_dbvar'}, {'Description': 'Related dbGaP record', 'Menu': 'dbGaP Links', 'DbTo': 'gap', 'Name': 'pubmed_gap'}, {'Description': 'Related GEO DataSets', 'Menu': 'GEO DataSet Links', 'DbTo': 'gds', 'Name': 'pubmed_gds'}, {'Description': 'Link to related Genes', 'Menu': 'Gene Links', 'DbTo': 'gene', 'Name': 'pubmed_gene'}, {'Description': 'Gene records in this citation', 'Menu': 'Gene (from Bookshelf)', 'DbTo': 'gene', 'Name': 'pubmed_gene_bookrecords'}, {'Description': 'PubMed links to Gene derived from pubmed_omim_cited links', 'Menu': 'Gene (OMIM) Links', 'DbTo': 'gene', 'Name': 'pubmed_gene_citedinomim'}, {'Description': 'Records in Gene identified from shared sequence and PMC links.', 'Menu': 'Gene (nucleotide/PMC)', 'DbTo': 'gene', 'Name': 'pubmed_gene_pmc_nucleotide'}, {'Description': 'Link to Gene for the GeneRIF subcategory', 'Menu': 'Gene (GeneRIF) Links', 'DbTo': 'gene', 'Name': 'pubmed_gene_rif'}, {'Description': 'Published genome sequences', 'Menu': 'Genome Links', 'DbTo': 'genome', 'Name': 'pubmed_genome'}, {'Description': 'GEO records associated with pubmed record', 'Menu': 'GEO Profile Links', 'DbTo': 'geoprofiles', 'Name': 'pubmed_geoprofiles'}, {'Description': 'Related HomoloGene', 'Menu': 'HomoloGene Links', 'DbTo': 'homologene', 'Name': 'pubmed_homologene'}, {'Description': 'Related information in MedGen', 'Menu': 'MedGen', 'DbTo': 'medgen', 'Name': 'pubmed_medgen'}, {'Description': 'Related records in MedGen based on citations in GeneReviews and Medical Genetics Summaries', 'Menu': 'MedGen (Bookshelf cited)', 'DbTo': 'medgen', 'Name': 'pubmed_medgen_bookshelf_cited'}, {'Description': 'Related MedGen records', 'Menu': 'MedGen (GeneReviews)', 'DbTo': 'medgen', 'Name': 'pubmed_medgen_genereviews'}, {'Description': 'Related information in MedGen (OMIM)', 'Menu': 'MedGen (OMIM)', 'DbTo': 'medgen', 'Name': 'pubmed_medgen_omim'}, {'Description': 'Published Nucleotide sequences', 'Menu': 'Nucleotide Links', 'DbTo': 'nuccore', 'Name': 'pubmed_nuccore'}, {'Description': 'Link to Nucleotide RefSeqs', 'Menu': 'Nucleotide (RefSeq) Links', 'DbTo': 'nuccore', 'Name': 'pubmed_nuccore_refseq'}, {'Description': 'Links to nuccore', 'Menu': 'Nucleotide (Weighted) Links', 'DbTo': 'nuccore', 'Name': 'pubmed_nuccore_weighted'}, {'Description': 'Published EST sequences', 'Menu': 'EST Links', 'DbTo': 'nucest', 'Name': 'pubmed_nucest'}, {'Description': 'Published GSS sequences', 'Menu': 'GSS Links', 'DbTo': 'nucgss', 'Name': 'pubmed_nucgss'}, {'Description': 'OMIM records in this citation', 'Menu': 'OMIM (from Bookshelf)', 'DbTo': 'omim', 'Name': 'pubmed_omim_bookrecords'}, {'Description': 'OMIM (calculated) Links', 'Menu': 'OMIM (calculated) Links', 'DbTo': 'omim', 'Name': 'pubmed_omim_calculated'}, {'Description': 'OMIM (cited) Links', 'Menu': 'OMIM (cited) Links', 'DbTo': 'omim', 'Name': 'pubmed_omim_cited'}, {'Description': 'Related PubChem BioAssay', 'Menu': 'PubChem BioAssay', 'DbTo': 'pcassay', 'Name': 'pubmed_pcassay'}, {'Description': 'Related PubChem Compound', 'Menu': 'PubChem Compound', 'DbTo': 'pccompound', 'Name': 'pubmed_pccompound'}, {'Description': 'Related PubChem Compound via MeSH', 'Menu': 'PubChem Compound (MeSH Keyword)', 'DbTo': 'pccompound', 'Name': 'pubmed_pccompound_mesh'}, {'Description': 'Publisher deposited structures linked to PubChem Compound', 'Menu': 'PubChem Compound (Publisher)', 'DbTo': 'pccompound', 'Name': 'pubmed_pccompound_publisher'}, {'Description': 'Related PubChem Substance', 'Menu': 'PubChem Substance Links', 'DbTo': 'pcsubstance', 'Name': 'pubmed_pcsubstance'}, {'Description': 'Structures in the PubChem Substance database in this citation', 'Menu': 'PubChem Substance (from Bookshelf)', 'DbTo': 'pcsubstance', 'Name': 'pubmed_pcsubstance_bookrecords'}, {'Description': 'PubChem Substances supplied by publisher', 'Menu': 'PubChem Substance (Publisher)', 'DbTo': 'pcsubstance', 'Name': 'pubmed_pcsubstance_publisher'}, {'Description': 'Free full text articles in PMC', 'Menu': 'PMC Links', 'DbTo': 'pmc', 'Name': 'pubmed_pmc'}, {'Description': 'Full text of articles in PubMed Central cited in this record', 'Menu': 'References in PMC for this Bookshelf citation', 'DbTo': 'pmc', 'Name': 'pubmed_pmc_bookrecords'}, {'Description': 'Embargoed PMC article associated with PubMed', 'Menu': '', 'DbTo': 'pmc', 'Name': 'pubmed_pmc_embargo'}, {'Description': 'Free full text articles in PMC', 'Menu': '', 'DbTo': 'pmc', 'Name': 'pubmed_pmc_local'}, {'Description': 'PubMed links associated with PMC', 'Menu': 'Cited in PMC', 'DbTo': 'pmc', 'Name': 'pubmed_pmc_refs'}, {'Description': 'Published population set', 'Menu': 'PopSet Links', 'DbTo': 'popset', 'Name': 'pubmed_popset'}, {'Description': 'Related Probe entry', 'Menu': 'Probe Links', 'DbTo': 'probe', 'Name': 'pubmed_probe'}, {'Description': 'Published protein sequences', 'Menu': 'Protein Links', 'DbTo': 'protein', 'Name': 'pubmed_protein'}, {'Description': 'Link to Protein RefSeqs', 'Menu': 'Protein (RefSeq) Links', 'DbTo': 'protein', 'Name': 'pubmed_protein_refseq'}, {'Description': 'Links to protein', 'Menu': 'Protein (Weighted) Links', 'DbTo': 'protein', 'Name': 'pubmed_protein_weighted'}, {'Description': 'Related Protein Clusters', 'Menu': 'Protein Cluster Links', 'DbTo': 'proteinclusters', 'Name': 'pubmed_proteinclusters'}, {'Description': 'Calculated set of PubMed citations similar to the selected article(s) retrieved using a word weight algorithm. Similar articles are displayed in ranked order from most to least similar, with the “linked from” citation displayed first.', 'Menu': 'Similar articles', 'DbTo': 'pubmed', 'Name': 'pubmed_pubmed'}, {'Description': '<p>Links to additional articles that others frequently viewed together with your selection.</p><p><i>An experimental new feature from PubMed Labs</i>.</p>', 'Menu': 'Articles frequently viewed together', 'DbTo': 'pubmed', 'Name': 'pubmed_pubmed_alsoviewed'}, {'Description': 'PubMed abstracts for articles cited in this record', 'Menu': 'References for this Bookshelf citation', 'DbTo': 'pubmed', 'Name': 'pubmed_pubmed_bookrecords'}, {'Description': 'PubMed Health systematic reviews that cite this article.', 'Menu': 'Cited in systematic reviews', 'DbTo': 'pubmed', 'Name': 'pubmed_pubmed_pmh_cited'}, {'Description': 'References for this PMC Article', 'Menu': 'References for PMC Articles', 'DbTo': 'pubmed', 'Name': 'pubmed_pubmed_refs'}, {'Description': 'PubMed to SNP links', 'Menu': 'SNP Links', 'DbTo': 'snp', 'Name': 'pubmed_snp'}, {'Description': 'Related SNP (Cited) records', 'Menu': 'SNP (Cited)', 'DbTo': 'snp', 'Name': 'pubmed_snp_cited'}, {'Description': 'Links to Short Read Archive Experiments', 'Menu': 'SRA Links', 'DbTo': 'sra', 'Name': 'pubmed_sra'}, {'Description': 'Published 3D structures', 'Menu': 'Structure Links', 'DbTo': 'structure', 'Name': 'pubmed_structure'}, {'Description': 'Related Taxonomy entry computed using other Entrez links', 'Menu': 'Taxonomy via GenBank', 'DbTo': 'taxonomy', 'Name': 'pubmed_taxonomy_entrez'}, {'Description': 'Related UniGene', 'Menu': 'UniGene Links', 'DbTo': 'unigene', 'Name': 'pubmed_unigene'}], 'Description': 'PubMed bibliographic record', 'DbBuild': 'Build161110-2247m.1', 'MenuName': 'PubMed', 'FieldList': [{'IsNumerical': 'N', 'FullName': 'All Fields', 'TermCount': '179662784', 'SingleToken': 'N', 'Description': 'All terms from all searchable fields', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'ALL'}, {'IsNumerical': 'Y', 'FullName': 'UID', 'TermCount': '0', 'SingleToken': 'Y', 'Description': 'Unique number assigned to publication', 'IsDate': 'N', 'IsHidden': 'Y', 'Hierarchy': 'N', 'Name': 'UID'}, {'IsNumerical': 'N', 'FullName': 'Filter', 'TermCount': '10010', 'SingleToken': 'Y', 'Description': 'Limits the records', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'FILT'}, {'IsNumerical': 'N', 'FullName': 'Title', 'TermCount': '16239663', 'SingleToken': 'N', 'Description': 'Words in title of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'TITL'}, {'IsNumerical': 'N', 'FullName': 'Text Word', 'TermCount': '57203893', 'SingleToken': 'N', 'Description': 'Free text associated with publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'WORD'}, {'IsNumerical': 'N', 'FullName': 'MeSH Terms', 'TermCount': '608343', 'SingleToken': 'Y', 'Description': 'Medical Subject Headings assigned to publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'Y', 'Name': 'MESH'}, {'IsNumerical': 'N', 'FullName': 'MeSH Major Topic', 'TermCount': '544923', 'SingleToken': 'Y', 'Description': 'MeSH terms of major importance to publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'Y', 'Name': 'MAJR'}, {'IsNumerical': 'N', 'FullName': 'Author', 'TermCount': '17774068', 'SingleToken': 'Y', 'Description': 'Author(s) of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'AUTH'}, {'IsNumerical': 'N', 'FullName': 'Journal', 'TermCount': '183816', 'SingleToken': 'Y', 'Description': 'Journal abbreviation of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'JOUR'}, {'IsNumerical': 'N', 'FullName': 'Affiliation', 'TermCount': '38492277', 'SingleToken': 'N', 'Description': "Author's institutional affiliation and address", 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'AFFL'}, {'IsNumerical': 'N', 'FullName': 'EC/RN Number', 'TermCount': '95990', 'SingleToken': 'Y', 'Description': 'EC number for enzyme or CAS registry number', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'ECNO'}, {'IsNumerical': 'N', 'FullName': 'Supplementary Concept', 'TermCount': '248253', 'SingleToken': 'Y', 'Description': 'CAS chemical name or MEDLINE Substance Name', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'SUBS'}, {'IsNumerical': 'N', 'FullName': 'Date - Publication', 'TermCount': '37958', 'SingleToken': 'Y', 'Description': 'Date of publication', 'IsDate': 'Y', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'PDAT'}, {'IsNumerical': 'N', 'FullName': 'Date - Entrez', 'TermCount': '36739', 'SingleToken': 'Y', 'Description': 'Date publication first accessible through Entrez', 'IsDate': 'Y', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'EDAT'}, {'IsNumerical': 'N', 'FullName': 'Volume', 'TermCount': '12428', 'SingleToken': 'Y', 'Description': 'Volume number of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'VOL'}, {'IsNumerical': 'N', 'FullName': 'Pagination', 'TermCount': '2495631', 'SingleToken': 'Y', 'Description': 'Page number(s) of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'PAGE'}, {'IsNumerical': 'N', 'FullName': 'Publication Type', 'TermCount': '80', 'SingleToken': 'Y', 'Description': 'Type of publication (e.g., review)', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'Y', 'Name': 'PTYP'}, {'IsNumerical': 'N', 'FullName': 'Language', 'TermCount': '58', 'SingleToken': 'Y', 'Description': 'Language of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'LANG'}, {'IsNumerical': 'N', 'FullName': 'Issue', 'TermCount': '16228', 'SingleToken': 'Y', 'Description': 'Issue number of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'ISS'}, {'IsNumerical': 'N', 'FullName': 'MeSH Subheading', 'TermCount': '82', 'SingleToken': 'Y', 'Description': 'Additional specificity for MeSH term', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'Y', 'Name': 'SUBH'}, {'IsNumerical': 'N', 'FullName': 'Secondary Source ID', 'TermCount': '7604738', 'SingleToken': 'Y', 'Description': 'Cross-reference from publication to other databases', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'SI'}, {'IsNumerical': 'N', 'FullName': 'Date - MeSH', 'TermCount': '36582', 'SingleToken': 'Y', 'Description': 'Date publication was indexed with MeSH terms', 'IsDate': 'Y', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'MHDA'}, {'IsNumerical': 'N', 'FullName': 'Title/Abstract', 'TermCount': '48737619', 'SingleToken': 'N', 'Description': 'Free text associated with Abstract/Title', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'TIAB'}, {'IsNumerical': 'N', 'FullName': 'Other Term', 'TermCount': '2596531', 'SingleToken': 'N', 'Description': 'Other terms associated with publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'OTRM'}, {'IsNumerical': 'N', 'FullName': 'Investigator', 'TermCount': '1391149', 'SingleToken': 'Y', 'Description': 'Investigator', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'INVR'}, {'IsNumerical': 'N', 'FullName': 'Author - Corporate', 'TermCount': '218164', 'SingleToken': 'N', 'Description': 'Corporate Author of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'COLN'}, {'IsNumerical': 'N', 'FullName': 'Place of Publication', 'TermCount': '229', 'SingleToken': 'N', 'Description': 'Country of publication', 'IsDate': 'N', 'IsHidden': 'Y', 'Hierarchy': 'N', 'Name': 'CNTY'}, {'IsNumerical': 'N', 'FullName': 'Pharmacological Action', 'TermCount': '514', 'SingleToken': 'Y', 'Description': 'MeSH pharmacological action pre-explosions', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'PAPX'}, {'IsNumerical': 'N', 'FullName': 'Grant Number', 'TermCount': '3692445', 'SingleToken': 'Y', 'Description': 'NIH Grant Numbers', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'GRNT'}, {'IsNumerical': 'N', 'FullName': 'Date - Modification', 'TermCount': '6408', 'SingleToken': 'Y', 'Description': 'Date of last modification', 'IsDate': 'Y', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'MDAT'}, {'IsNumerical': 'N', 'FullName': 'Date - Completion', 'TermCount': '11118', 'SingleToken': 'Y', 'Description': 'Date of completion', 'IsDate': 'Y', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'CDAT'}, {'IsNumerical': 'N', 'FullName': 'Publisher ID', 'TermCount': '18489480', 'SingleToken': 'Y', 'Description': 'Publisher ID', 'IsDate': 'N', 'IsHidden': 'Y', 'Hierarchy': 'N', 'Name': 'PID'}, {'IsNumerical': 'N', 'FullName': 'Author - First', 'TermCount': '9653565', 'SingleToken': 'Y', 'Description': 'First Author of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'FAUT'}, {'IsNumerical': 'N', 'FullName': 'Author - Full', 'TermCount': '11174516', 'SingleToken': 'Y', 'Description': 'Full Author Name(s) of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'FULL'}, {'IsNumerical': 'N', 'FullName': 'Investigator - Full', 'TermCount': '764826', 'SingleToken': 'Y', 'Description': 'Full name of investigator', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'FINV'}, {'IsNumerical': 'N', 'FullName': 'Transliterated Title', 'TermCount': '2291241', 'SingleToken': 'N', 'Description': 'Words in transliterated title of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'TT'}, {'IsNumerical': 'N', 'FullName': 'Author - Last', 'TermCount': '8338748', 'SingleToken': 'Y', 'Description': 'Last Author of publication', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'LAUT'}, {'IsNumerical': 'N', 'FullName': 'Print Publication Date', 'TermCount': '37955', 'SingleToken': 'Y', 'Description': 'Date of print publication', 'IsDate': 'Y', 'IsHidden': 'Y', 'Hierarchy': 'N', 'Name': 'PPDT'}, {'IsNumerical': 'N', 'FullName': 'Electronic Publication Date', 'TermCount': '6566', 'SingleToken': 'Y', 'Description': 'Date of Electronic publication', 'IsDate': 'Y', 'IsHidden': 'Y', 'Hierarchy': 'N', 'Name': 'EPDT'}, {'IsNumerical': 'N', 'FullName': 'Location ID', 'TermCount': '11658889', 'SingleToken': 'Y', 'Description': 'ELocation ID', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'LID'}, {'IsNumerical': 'N', 'FullName': 'Date - Create', 'TermCount': '29530', 'SingleToken': 'Y', 'Description': 'Date publication first accessible through Entrez', 'IsDate': 'Y', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'CRDT'}, {'IsNumerical': 'N', 'FullName': 'Book', 'TermCount': '4159', 'SingleToken': 'Y', 'Description': 'ID of the book that contains the document', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'BOOK'}, {'IsNumerical': 'N', 'FullName': 'Editor', 'TermCount': '3881', 'SingleToken': 'Y', 'Description': "Section's Editor", 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'ED'}, {'IsNumerical': 'N', 'FullName': 'ISBN', 'TermCount': '2801', 'SingleToken': 'Y', 'Description': 'ISBN', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'ISBN'}, {'IsNumerical': 'N', 'FullName': 'Publisher', 'TermCount': '455', 'SingleToken': 'Y', 'Description': "Publisher's name", 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'PUBN'}, {'IsNumerical': 'N', 'FullName': 'Author Cluster ID', 'TermCount': '0', 'SingleToken': 'Y', 'Description': 'Author Cluster ID', 'IsDate': 'N', 'IsHidden': 'Y', 'Hierarchy': 'N', 'Name': 'AUCL'}, {'IsNumerical': 'N', 'FullName': 'Extended PMID', 'TermCount': '26636117', 'SingleToken': 'Y', 'Description': 'Extended PMID', 'IsDate': 'N', 'IsHidden': 'Y', 'Hierarchy': 'N', 'Name': 'EID'}, {'IsNumerical': 'N', 'FullName': 'DSO', 'TermCount': '285241', 'SingleToken': 'N', 'Description': 'Additional text from the summary', 'IsDate': 'N', 'IsHidden': 'Y', 'Hierarchy': 'N', 'Name': 'DSO'}, {'IsNumerical': 'N', 'FullName': 'Author - Identifier', 'TermCount': '519701', 'SingleToken': 'Y', 'Description': 'Author Identifier', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'AUID'}, {'IsNumerical': 'N', 'FullName': 'Subject - Personal Name', 'TermCount': '530123', 'SingleToken': 'Y', 'Description': 'Personal Name as Subject', 'IsDate': 'N', 'IsHidden': 'N', 'Hierarchy': 'N', 'Name': 'PS'}]}

I would like to pass this data to a text file. in the following format.

LastUpdate: 2016/11/11 04:34
Count: 26645932
DbName: pubmed
...
...

However my code does not return even the list of values of these keys by the dictionary. The Test Class is as follows:

class Contact:
    def __init__(self, dic):
        self.lista = list((self.NestedDictValues(dic))

    def NestedDictValues(self,d):
        for v in d.values():
            if isinstance(v,dict):
                yield from NestedDictValues(v)
            else:
                yield v

The return when I call the class with a simple dictionary is as follows:

<Classe.Contact object at 0x7fae3f486b70>

How to extract these tuples? Why this code extracts all the values from the dictionary but I would have to take the key along with the content. This method can extract values from the dictionary but when placed in class it does not work.

  • Already tried list(Contact.Nesteddictvalues(mydict))?

  • I just tested it doesn’t work either

1 answer

1


Browser other questions tagged

You are not signed in. Login or sign up in order to post.