solution_070d.py

#!/usr/bin/python3
# ====================================================================
# from: stackoverflow.com/questions/55180196/
#       get-coordinates-of-nodes-using-osm-ids
# --------------------------------------------------------------------
# to install osmnx: pip install osmapi
# ====================================================================

import osmapi as osm

node_id=1989098258


# this instantiate the OsmApi class,
# it has many function, we will use NodeGet function.
# For more detail about it check the doc
# http://osmapi.metaodi.ch/osmapi.OsmApi.OsmApi.NodeGet

api = osm.OsmApi()

node = api.NodeGet(node_id)

print()
for k,v in node.items():
    print(f'{k:10} : {v}')

print('----no tags?-----------------------------')
print()
for k,v in node['tag']:
    print(f'{k:10} : {v}')