Skip to content

Instantly share code, notes, and snippets.

@shawngraham
Last active February 26, 2020 17:34
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save shawngraham/2ebf6332313ddf60efab4ac45ee6f19f to your computer and use it in GitHub Desktop.
Save shawngraham/2ebf6332313ddf60efab4ac45ee6f19f to your computer and use it in GitHub Desktop.
parsing json
import json
with open('ottawadata.json') as f:
data = json.load(f)
....now, what cunning piece of code would do the trick? with jqplay I can get eg latitude with
.content.indexedStructured.geoLocation[]|.points[].latitude.content
anyway... off to read some basic python stuff I guess.
{"status": 200, "responseCode": 1, "response": {"rows": [{"id": "edanmdm-nmnhentomology_11816124", "title": "Neophylax ottawa", "unitCode": "NMNHENTO", "type": "edanmdm", "url": "edanmdm:nmnhentomology_11816124", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhentomology_11816124", "guid": "http://n2t.net/ark:/65665/34294f8c0-7a6c-474f-b293-cd30c96b0977", "title_sort": "NEOPHYLAX OTTAWA", "unit_code": "NMNHENTO", "record_link": "http://n2t.net/ark:/65665/34294f8c0-7a6c-474f-b293-cd30c96b0977", "title": {"label": "title", "content": "Neophylax ottawa"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Entomology Dept."}, "indexedStructured": {"tax_family": ["Uenoidae"], "tax_phylum": ["Arthropoda"], "tax_class": ["Insecta"], "tax_order": ["Trichoptera"], "tax_kingdom": ["Animalia"], "topic": ["Insects"], "scientific_name": ["Neophylax ottawa Vineyard & Wiggins, 1987"]}, "freetext": {"setName": [{"label": "See more items in", "content": "Species Inventory"}], "notes": [{"label": "Record Last Modified", "content": "17 Sep 2015"}, {"label": "Specimen Count", "content": "1"}], "publisher": [{"label": "Published Name", "content": "Neophylax ottawa Vineyard & Wiggins, 1987"}], "physicalDescription": [{"label": "Prep Count", "content": "1"}, {"label": "Preparation", "content": "Vial"}, {"label": "Stage", "content": "Adult"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Entomology Dept."}], "taxonomicName": [{"label": "Taxonomy", "content": "Animalia, Arthropoda, Insecta, Trichoptera, Uenoidae"}]}}, "hash": "2a90e4b78e3ce34d73d9f972267d08784510130f", "docSignature": "a1ea93de1459197f0ffc20329b6d7dbfb3ff0fbe_e33b312c6ff88bde0133996cff27f250", "timestamp": "1579275406", "lastTimeUpdated": "1579275311", "version": ""}, {"id": "edanmdm-nmnhmineralsciences_1119112", "title": "Diopside", "unitCode": "NMNHMINSCI", "type": "edanmdm", "url": "edanmdm:nmnhmineralsciences_1119112", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhmineralsciences_1119112", "guid": "http://n2t.net/ark:/65665/3ca571a29-b5df-4a68-968e-d1a367ea8f07", "title_sort": "DIOPSIDE", "unit_code": "NMNHMINSCI", "record_link": "http://n2t.net/ark:/65665/3ca571a29-b5df-4a68-968e-d1a367ea8f07", "title": {"label": "title", "content": "Diopside"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Mineral Sciences Dept."}, "indexedStructured": {"geoLocation": [{"L1": {"type": "Continent", "content": "North America"}, "L2": {"type": "Country", "content": "Canada"}, "L3": {"type": "State", "content": "Ontario"}, "L4": {"type": "County", "content": "Ottawa Co."}, "points": {"point": {"latitude": {"type": "decimal", "content": "45.25"}, "longitude": {"type": "decimal", "content": "-75.8"}}}}], "topic": ["Mineralogy"], "scientific_name": ["Diopside"], "place": ["Canada", "Ottawa Co.", "North America", "Ontario"]}, "freetext": {"setName": [{"label": "See more items in", "content": "Mineral Sciences"}, {"label": "See more items in", "content": "Minerals"}], "identifier": [{"label": "Other Numbers", "content": "IGSN : NHB0008LD"}, {"label": "USNM Number", "content": "8814700"}], "notes": [{"label": "Record Last Modified", "content": "1 Jul 2016"}, {"label": "Site Number", "content": "6094816"}, {"label": "Specimen Count", "content": "1"}], "name": [{"label": "Site Name", "content": "Ottawa"}, {"label": "Taxon", "content": "Diopside - Primary Mineral"}], "place": [{"label": "Place", "content": "Ottawa Co., Ontario, Canada, North America"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Mineral Sciences Dept."}]}}, "hash": "23a46a543ea52ee89816730571e661028e5b203b", "docSignature": "aad680abb5a5eeb29bfb6b2c347680582ef06166_9434fdfefd98053e2afc9c6a0d064298", "timestamp": "1579278235", "lastTimeUpdated": "1579278186", "version": ""}, {"id": "edanmdm-nmnhvz_10091118", "title": "Morone americana", "unitCode": "NMNHFISHES", "type": "edanmdm", "url": "edanmdm:nmnhvz_10091118", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhvz_10091118", "guid": "http://n2t.net/ark:/65665/31bf56a1c-b776-47c8-a966-1b6ada2e2750", "title_sort": "MORONE AMERICANA", "unit_code": "NMNHFISHES", "record_link": "http://n2t.net/ark:/65665/31bf56a1c-b776-47c8-a966-1b6ada2e2750", "title": {"label": "title", "content": "Morone americana"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Vertebrate Zoology - Fishes Division"}, "indexedStructured": {"date": ["1980s"], "tax_family": ["Moronidae"], "tax_phylum": ["Chordata"], "geoLocation": [{"L1": {"type": "Continent", "content": "North America"}, "L2": {"type": "Country", "content": "United States"}, "L3": {"type": "State", "content": "Ohio"}, "L4": {"type": "County", "content": "Ottawa County"}, "Other": {"type": "Locality", "content": "Twilliger's Pond, Put-in-Bay, Ottawa Co., Ohio"}}], "tax_class": ["Actinopterygii"], "tax_order": ["Perciformes"], "name": ["Class", "Berra, T. M."], "tax_kingdom": ["Animalia"], "topic": ["Actinopterygii", "Fishes"], "scientific_name": ["Morone americana"], "place": ["United States", "Ohio", "North America", "Ottawa County"]}, "freetext": {"date": [{"label": "Collection Date", "content": "2 Jul 1981"}], "setName": [{"label": "See more items in", "content": "Vertebrate Zoology"}, {"label": "See more items in", "content": "Fishes"}], "identifier": [{"label": "Accession Number", "content": "2051691"}, {"label": "USNM Number", "content": "404338"}], "notes": [{"label": "Record Last Modified", "content": "12 Dec 2017"}, {"label": "Specimen Count", "content": "1"}], "name": [{"label": "Collector", "content": "Dr. Timothy M. Berra"}, {"label": "Collector", "content": "Class"}], "publisher": [{"label": "Published Name", "content": "Morone americana"}], "place": [{"label": "Place", "content": "Twilliger's Pond, Put-in-Bay, Ottawa Co., Ohio, Ottawa County, Ohio, United States, North America"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Vertebrate Zoology - Fishes Division"}], "taxonomicName": [{"label": "Taxonomy", "content": "Animalia, Chordata, Vertebrata, Osteichthyes, Actinopterygii, Neopterygii, Acanthopterygii, Perciformes, Percoidei, Moronidae"}]}}, "hash": "82edecd59a9fcf4b24b6e5fb73687842067e28ec", "docSignature": "1667f2b835a3cecf2bc680876b06c30206965bf9_435b33ce3701aff56978eba34b6b7a13", "timestamp": "1579296044", "lastTimeUpdated": "1579296002", "version": ""}, {"id": "edanmdm-nmnhvz_10091123", "title": "Pomoxis annularis", "unitCode": "NMNHFISHES", "type": "edanmdm", "url": "edanmdm:nmnhvz_10091123", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhvz_10091123", "guid": "http://n2t.net/ark:/65665/3b43f653a-ee78-43f4-83b0-118b0b942164", "title_sort": "POMOXIS ANNULARIS", "unit_code": "NMNHFISHES", "record_link": "http://n2t.net/ark:/65665/3b43f653a-ee78-43f4-83b0-118b0b942164", "title": {"label": "title", "content": "Pomoxis annularis"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Vertebrate Zoology - Fishes Division"}, "indexedStructured": {"date": ["1980s"], "tax_family": ["Centrarchidae"], "tax_phylum": ["Chordata"], "geoLocation": [{"L1": {"type": "Continent", "content": "North America"}, "L2": {"type": "Country", "content": "United States"}, "L3": {"type": "State", "content": "Ohio"}, "L4": {"type": "County", "content": "Ottawa County"}, "Other": {"type": "Locality", "content": "Twilliger's Pond, Put-in-Bay, Ottawa Co., Ohio"}}], "tax_class": ["Actinopterygii"], "tax_order": ["Perciformes"], "name": ["Class", "Berra, T. M."], "tax_kingdom": ["Animalia"], "topic": ["Actinopterygii", "Fishes"], "scientific_name": ["Pomoxis annularis"], "place": ["United States", "Ohio", "North America", "Ottawa County"]}, "freetext": {"date": [{"label": "Collection Date", "content": "2 Jul 1981"}], "setName": [{"label": "See more items in", "content": "Vertebrate Zoology"}, {"label": "See more items in", "content": "Fishes"}], "identifier": [{"label": "Accession Number", "content": "2051691"}, {"label": "USNM Number", "content": "404341"}], "notes": [{"label": "Record Last Modified", "content": "12 Dec 2017"}, {"label": "Specimen Count", "content": "1"}], "name": [{"label": "Collector", "content": "Dr. Timothy M. Berra"}, {"label": "Collector", "content": "Class"}], "publisher": [{"label": "Published Name", "content": "Pomoxis annularis"}], "place": [{"label": "Place", "content": "Twilliger's Pond, Put-in-Bay, Ottawa Co., Ohio, Ottawa County, Ohio, United States, North America"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Vertebrate Zoology - Fishes Division"}], "taxonomicName": [{"label": "Taxonomy", "content": "Animalia, Chordata, Vertebrata, Osteichthyes, Actinopterygii, Neopterygii, Acanthopterygii, Perciformes, Percoidei, Centrarchidae"}]}}, "hash": "a4ad030d12a053a7002548bd0523f6d12290f940", "docSignature": "562d1add093d68c577559727c8b1b26d3c1c4d34_3446e0898074035a2d6b13876a7b29dc", "timestamp": "1579296044", "lastTimeUpdated": "1579296002", "version": ""}, {"id": "edanmdm-nmnhvz_10091119", "title": "Morone americana", "unitCode": "NMNHFISHES", "type": "edanmdm", "url": "edanmdm:nmnhvz_10091119", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhvz_10091119", "guid": "http://n2t.net/ark:/65665/3517202fc-173b-41d0-968c-61c58644140d", "title_sort": "MORONE AMERICANA", "unit_code": "NMNHFISHES", "record_link": "http://n2t.net/ark:/65665/3517202fc-173b-41d0-968c-61c58644140d", "title": {"label": "title", "content": "Morone americana"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Vertebrate Zoology - Fishes Division"}, "indexedStructured": {"date": ["1980s"], "tax_family": ["Moronidae"], "tax_phylum": ["Chordata"], "geoLocation": [{"L1": {"type": "Continent", "content": "North America"}, "L2": {"type": "Country", "content": "United States"}, "L3": {"type": "State", "content": "Ohio"}, "L4": {"type": "County", "content": "Ottawa County"}, "Other": {"type": "Locality", "content": "Catawaba Island Girl Scout Camp in Idolwild's Embayment of western shoreline, Ottawa County, Ohio"}}], "tax_class": ["Actinopterygii"], "tax_order": ["Perciformes"], "name": ["Herdendorf"], "tax_kingdom": ["Animalia"], "topic": ["Actinopterygii", "Fishes"], "scientific_name": ["Morone americana"], "place": ["United States", "Ohio", "North America", "Ottawa County"]}, "freetext": {"date": [{"label": "Collection Date", "content": "15 Jul 1981"}], "setName": [{"label": "See more items in", "content": "Vertebrate Zoology"}, {"label": "See more items in", "content": "Fishes"}], "identifier": [{"label": "Accession Number", "content": "2051691"}, {"label": "USNM Number", "content": "404339"}], "notes": [{"label": "Record Last Modified", "content": "25 Aug 2014"}, {"label": "Specimen Count", "content": "1"}], "name": [{"label": "Collector", "content": "Dr. Herdendorf"}], "publisher": [{"label": "Published Name", "content": "Morone americana"}], "place": [{"label": "Place", "content": "Catawaba Island Girl Scout Camp in Idolwild's Embayment of western shoreline, Ottawa County, Ohio, Ottawa County, Ohio, United States, North America"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Vertebrate Zoology - Fishes Division"}], "taxonomicName": [{"label": "Taxonomy", "content": "Animalia, Chordata, Vertebrata, Osteichthyes, Actinopterygii, Neopterygii, Acanthopterygii, Perciformes, Percoidei, Moronidae"}]}}, "hash": "68c2cb6d54cfabd504a0c0819f3804aec323fd05", "docSignature": "7a547daef3cb96d10a6474cd93686ddfa3174a1c_45c3d757aa0e1aa29447f0483954851f", "timestamp": "1579296044", "lastTimeUpdated": "1579296002", "version": ""}, {"id": "edanmdm-nmnhvz_10046499", "title": "Notemigonus crysoleucas", "unitCode": "NMNHFISHES", "type": "edanmdm", "url": "edanmdm:nmnhvz_10046499", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhvz_10046499", "guid": "http://n2t.net/ark:/65665/3a76ba91b-c144-495d-bd65-4c3b4055903c", "title_sort": "NOTEMIGONUS CRYSOLEUCAS", "unit_code": "NMNHFISHES", "record_link": "http://n2t.net/ark:/65665/3a76ba91b-c144-495d-bd65-4c3b4055903c", "title": {"label": "title", "content": "Notemigonus crysoleucas"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Vertebrate Zoology - Fishes Division"}, "indexedStructured": {"date": ["1980s"], "tax_family": ["Cyprinidae"], "tax_phylum": ["Chordata"], "geoLocation": [{"L1": {"type": "Continent", "content": "North America"}, "L2": {"type": "Country", "content": "United States"}, "L3": {"type": "State", "content": "Ohio"}, "L4": {"type": "County", "content": "Ottawa County"}, "Other": {"type": "Locality", "content": "Idolwile Embayment, Catawba Island Girl Scout Camp, Ottawa County. Lake Erie drainage"}}], "tax_class": ["Actinopterygii"], "tax_order": ["Cypriniformes"], "name": ["Herdendorf"], "tax_kingdom": ["Animalia"], "topic": ["Actinopterygii", "Fishes"], "scientific_name": ["Notemigonus crysoleucas"], "place": ["United States", "Ohio", "North America", "Ottawa County"]}, "freetext": {"date": [{"label": "Collection Date", "content": "8 Jul 1981"}], "setName": [{"label": "See more items in", "content": "Vertebrate Zoology"}, {"label": "See more items in", "content": "Fishes"}], "identifier": [{"label": "Accession Number", "content": "2051691"}, {"label": "USNM Number", "content": "401235"}], "notes": [{"label": "Record Last Modified", "content": "23 May 2017"}, {"label": "Specimen Count", "content": "1"}], "name": [{"label": "Collector", "content": "Dr. Herdendorf"}], "publisher": [{"label": "Published Name", "content": "Notemigonus crysoleucas"}], "place": [{"label": "Place", "content": "Idolwile Embayment, Catawba Island Girl Scout Camp, Ottawa County. Lake Erie drainage, Ottawa County, Ohio, United States, North America"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Vertebrate Zoology - Fishes Division"}], "taxonomicName": [{"label": "Taxonomy", "content": "Animalia, Chordata, Vertebrata, Osteichthyes, Actinopterygii, Neopterygii, Ostariophysi, Cypriniformes, Cyprinidae"}]}}, "hash": "63112feb6e9b0c6088d083f780f22adcb2159a0b", "docSignature": "b76e9bb419dbbd3bf2de4731d6d37a49a58dea6a_ab8e86d8e1827acf237bad834b1f274d", "timestamp": "1579279216", "lastTimeUpdated": "1579279163", "version": ""}, {"id": "edanmdm-nmnhvz_10034344", "title": "Pimephales notatus", "unitCode": "NMNHFISHES", "type": "edanmdm", "url": "edanmdm:nmnhvz_10034344", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhvz_10034344", "guid": "http://n2t.net/ark:/65665/398f19dd7-0371-4d75-bb67-497de9c154c5", "title_sort": "PIMEPHALES NOTATUS", "unit_code": "NMNHFISHES", "record_link": "http://n2t.net/ark:/65665/398f19dd7-0371-4d75-bb67-497de9c154c5", "title": {"label": "title", "content": "Pimephales notatus"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Vertebrate Zoology - Fishes Division"}, "indexedStructured": {"date": ["1980s"], "tax_family": ["Cyprinidae"], "tax_phylum": ["Chordata"], "geoLocation": [{"L1": {"type": "Continent", "content": "North America"}, "L2": {"type": "Country", "content": "United States"}, "L3": {"type": "State", "content": "Ohio"}, "L4": {"type": "County", "content": "Ottawa County"}, "Other": {"type": "Locality", "content": "Catawaba Island Girl Scout Camp in Idolwild's Embayment of western shoreline, Ottawa County, Ohio"}}], "tax_class": ["Actinopterygii"], "tax_order": ["Cypriniformes"], "name": ["Herdendorf"], "tax_kingdom": ["Animalia"], "topic": ["Actinopterygii", "Fishes"], "scientific_name": ["Pimephales notatus"], "place": ["United States", "Ohio", "North America", "Ottawa County"]}, "freetext": {"date": [{"label": "Collection Date", "content": "15 Jul 1981"}], "setName": [{"label": "See more items in", "content": "Vertebrate Zoology"}, {"label": "See more items in", "content": "Fishes"}], "identifier": [{"label": "Accession Number", "content": "2051691"}, {"label": "USNM Number", "content": "400030"}], "notes": [{"label": "Record Last Modified", "content": "20 Aug 2014"}, {"label": "Specimen Count", "content": "1"}], "name": [{"label": "Collector", "content": "Dr. Herdendorf"}], "publisher": [{"label": "Published Name", "content": "Pimephales notatus"}], "place": [{"label": "Place", "content": "Catawaba Island Girl Scout Camp in Idolwild's Embayment of western shoreline, Ottawa County, Ohio, Ottawa County, Ohio, United States, North America"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Vertebrate Zoology - Fishes Division"}], "taxonomicName": [{"label": "Taxonomy", "content": "Animalia, Chordata, Vertebrata, Osteichthyes, Actinopterygii, Neopterygii, Ostariophysi, Cypriniformes, Cyprinidae"}]}}, "hash": "a8c290e823e2d061377addf72beda2f89ea32c20", "docSignature": "b38cb7d5553f404cee57f6109176a5b397e52c6b_808c955b004242d2375a29bab7192898", "timestamp": "1579279216", "lastTimeUpdated": "1579279163", "version": ""}, {"id": "edanmdm-nmnhvz_10045347", "title": "Notemigonus crysoleucas", "unitCode": "NMNHFISHES", "type": "edanmdm", "url": "edanmdm:nmnhvz_10045347", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhvz_10045347", "guid": "http://n2t.net/ark:/65665/36000659b-9dd8-4734-8328-4ff677411129", "title_sort": "NOTEMIGONUS CRYSOLEUCAS", "unit_code": "NMNHFISHES", "record_link": "http://n2t.net/ark:/65665/36000659b-9dd8-4734-8328-4ff677411129", "title": {"label": "title", "content": "Notemigonus crysoleucas"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Vertebrate Zoology - Fishes Division"}, "indexedStructured": {"date": ["1980s"], "tax_family": ["Cyprinidae"], "tax_phylum": ["Chordata"], "geoLocation": [{"L1": {"type": "Continent", "content": "North America"}, "L2": {"type": "Country", "content": "United States"}, "L3": {"type": "State", "content": "Ohio"}, "L4": {"type": "County", "content": "Ottawa County"}, "Other": {"type": "Locality", "content": "Catawaba Island Girl Scout Camp in Idolwild's Embayment of western shoreline, Ottawa County, Ohio"}}], "tax_class": ["Actinopterygii"], "tax_order": ["Cypriniformes"], "name": ["Herdendorf"], "tax_kingdom": ["Animalia"], "topic": ["Actinopterygii", "Fishes"], "scientific_name": ["Notemigonus crysoleucas"], "place": ["United States", "Ohio", "North America", "Ottawa County"]}, "freetext": {"date": [{"label": "Collection Date", "content": "15 Jul 1981"}], "setName": [{"label": "See more items in", "content": "Vertebrate Zoology"}, {"label": "See more items in", "content": "Fishes"}], "identifier": [{"label": "Accession Number", "content": "2051691"}, {"label": "USNM Number", "content": "401229"}], "notes": [{"label": "Record Last Modified", "content": "20 Aug 2014"}, {"label": "Specimen Count", "content": "1"}], "name": [{"label": "Collector", "content": "Dr. Herdendorf"}], "publisher": [{"label": "Published Name", "content": "Notemigonus crysoleucas"}], "place": [{"label": "Place", "content": "Catawaba Island Girl Scout Camp in Idolwild's Embayment of western shoreline, Ottawa County, Ohio, Ottawa County, Ohio, United States, North America"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Vertebrate Zoology - Fishes Division"}], "taxonomicName": [{"label": "Taxonomy", "content": "Animalia, Chordata, Vertebrata, Osteichthyes, Actinopterygii, Neopterygii, Ostariophysi, Cypriniformes, Cyprinidae"}]}}, "hash": "bfcc23746e303da357c653b16208c530fd506656", "docSignature": "edb1f3789e0be2b8dee75010a5ce72a3e0d246cb_c32d7c1d4510d170c1b5aa92f10ece5d", "timestamp": "1579279216", "lastTimeUpdated": "1579279163", "version": ""}, {"id": "edanmdm-nmnhvz_10049137", "title": "Percina caprodes", "unitCode": "NMNHFISHES", "type": "edanmdm", "url": "edanmdm:nmnhvz_10049137", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhvz_10049137", "guid": "http://n2t.net/ark:/65665/36dda51d0-71c3-4779-a125-0a8afe516872", "title_sort": "PERCINA CAPRODES", "unit_code": "NMNHFISHES", "record_link": "http://n2t.net/ark:/65665/36dda51d0-71c3-4779-a125-0a8afe516872", "title": {"label": "title", "content": "Percina caprodes"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Vertebrate Zoology - Fishes Division"}, "indexedStructured": {"date": ["1980s"], "tax_family": ["Percidae"], "tax_phylum": ["Chordata"], "geoLocation": [{"L1": {"type": "Continent", "content": "North America"}, "L2": {"type": "Country", "content": "United States"}, "L3": {"type": "State", "content": "Ohio"}, "L4": {"type": "County", "content": "Ottawa County"}, "Other": {"type": "Locality", "content": "Lake Erie around Gibraltar Island, Ottawa Co., Ohio"}}], "tax_class": ["Actinopterygii"], "tax_order": ["Perciformes"], "name": ["Class", "Berra, T. M."], "tax_kingdom": ["Animalia"], "topic": ["Actinopterygii", "Fishes"], "scientific_name": ["Percina caprodes"], "place": ["United States", "Ohio", "North America", "Ottawa County"]}, "freetext": {"date": [{"label": "Collection Date", "content": "27 Jun 1981"}], "setName": [{"label": "See more items in", "content": "Vertebrate Zoology"}, {"label": "See more items in", "content": "Fishes"}], "identifier": [{"label": "Accession Number", "content": "2051691"}, {"label": "USNM Number", "content": "401604"}], "notes": [{"label": "Record Last Modified", "content": "12 Dec 2017"}, {"label": "Specimen Count", "content": "2"}], "name": [{"label": "Collector", "content": "Dr. Timothy M. Berra"}, {"label": "Collector", "content": "Class"}], "publisher": [{"label": "Published Name", "content": "Percina caprodes"}], "place": [{"label": "Place", "content": "Lake Erie around Gibraltar Island, Ottawa Co., Ohio, Ottawa County, Ohio, United States, North America"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Vertebrate Zoology - Fishes Division"}], "taxonomicName": [{"label": "Taxonomy", "content": "Animalia, Chordata, Vertebrata, Osteichthyes, Actinopterygii, Neopterygii, Acanthopterygii, Perciformes, Percoidei, Percidae"}]}}, "hash": "19b69a9805d6e8d485316163210586ad578eff51", "docSignature": "418905a57d625f36ed5546a435d2cfbbcd402ef8_798d72c7ae7dfc98db054a319edfd304", "timestamp": "1579279227", "lastTimeUpdated": "1579279175", "version": ""}, {"id": "edanmdm-nmnhvz_10028337", "title": "Perca flavescens", "unitCode": "NMNHFISHES", "type": "edanmdm", "url": "edanmdm:nmnhvz_10028337", "content": {"descriptiveNonRepeating": {"record_ID": "nmnhvz_10028337", "guid": "http://n2t.net/ark:/65665/358e7cbc6-df0c-45cf-930a-7e389f168e2b", "title_sort": "PERCA FLAVESCENS", "unit_code": "NMNHFISHES", "record_link": "http://n2t.net/ark:/65665/358e7cbc6-df0c-45cf-930a-7e389f168e2b", "title": {"label": "title", "content": "Perca flavescens"}, "metadata_usage": {"access": "CC0"}, "data_source": "NMNH - Vertebrate Zoology - Fishes Division"}, "indexedStructured": {"date": ["1980s"], "tax_family": ["Percidae"], "tax_phylum": ["Chordata"], "geoLocation": [{"L1": {"type": "Continent", "content": "North America"}, "L2": {"type": "Country", "content": "United States"}, "L3": {"type": "State", "content": "Ohio"}, "L4": {"type": "County", "content": "Ottawa County"}, "Other": {"type": "Locality", "content": "Catawaba Island Girl Scout Camp in Idolwild's Embayment of western shoreline, Ottawa County, Ohio"}}], "tax_class": ["Actinopterygii"], "tax_order": ["Perciformes"], "name": ["Herdendorf"], "tax_kingdom": ["Animalia"], "topic": ["Actinopterygii", "Fishes"], "scientific_name": ["Perca flavescens"], "place": ["United States", "Ohio", "North America", "Ottawa County"]}, "freetext": {"date": [{"label": "Collection Date", "content": "15 Jul 1981"}], "setName": [{"label": "See more items in", "content": "Vertebrate Zoology"}, {"label": "See more items in", "content": "Fishes"}], "identifier": [{"label": "Accession Number", "content": "2051691"}, {"label": "USNM Number", "content": "400018"}], "notes": [{"label": "Record Last Modified", "content": "25 Aug 2014"}, {"label": "Specimen Count", "content": "1"}], "name": [{"label": "Collector", "content": "Dr. Herdendorf"}], "publisher": [{"label": "Published Name", "content": "Perca flavescens"}], "place": [{"label": "Place", "content": "Catawaba Island Girl Scout Camp in Idolwild's Embayment of western shoreline, Ottawa County, Ohio, Ottawa County, Ohio, United States, North America"}], "dataSource": [{"label": "Data Source", "content": "NMNH - Vertebrate Zoology - Fishes Division"}], "taxonomicName": [{"label": "Taxonomy", "content": "Animalia, Chordata, Vertebrata, Osteichthyes, Actinopterygii, Neopterygii, Acanthopterygii, Perciformes, Percoidei, Percidae"}]}}, "hash": "39975c0453deefd8691bc0c7246fe7f8e20d3d56", "docSignature": "eb8dc5f17bcf323c0d8c88190c730fa9287c0b45_a619e1e89a58c7a4321491c946eac8ed", "timestamp": "1579279227", "lastTimeUpdated": "1579279174", "version": ""}], "rowCount": 3312, "message": "content found"}}
@jeffblackadar
Copy link

jeffblackadar commented Feb 26, 2020

I think I am getting closer, but have to give up for now
I liked this
print(json.dumps(jdata, indent=4))
From:
https://codingnetworker.com/2015/10/python-dictionaries-json-crash-course/

#-----------------------------------

import json
f=open("c:\\aaa-rffi\\dxl.dxl", "r")
file_path = "C:\\ProgramData\\MySQL\\MySQL Server 8.0\\"
    
file_path = "c:\\aaa-rffi\\ottawadata.json"
with open(file_path, "r") as read_file:
    jdata = json.load(read_file)
  
for rows in jdata["response"]["rows"]:

    print(rows['id'])
    print(rows['content']['indexedStructured'])
    print("indexedStructured")
    for rowsc in rows['content']['indexedStructured']:
        print(rowsc)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment