0

I am accessing Geonames data via the python geocoder library https://github.com/DenisCarriere/geocoder

While I am able to use the g = geocoder.geonames(PLACE, _USERNAME) function to then have data such as g.address, g.lat etc, I am also usign the details, hyerarchy and children methods, but I'm not understanding how to cleanly extract the data from them.

For hierarchy I am using:

for entity in hierarchy._list:
    print(f"part-of: {entity}")

but I am utterly unable to understand how to access the children results. Using:

children = geocoder.geonames(g.geonames_id, key=_USERNAME, method="children")

but not finding how to access its content.

Robert Alexander
  • 875
  • 9
  • 24

0 Answers0