I have a list of tuples [(city, country)] and I have a large XML file which contains more information about the city.
Right now I take a tuple at a time and parse the XML file. Then I get a list of all the cities and compare their names with the city of my tuple. As I do that again and again for every tuple it is really slow so I would like to save the cities of the XML somehow (connected to their extra information). What would be an efficient way concerning that I want to search through it by the name of the city in the tuple?
At first I thought about objects in a set ... But is it possible to search quickly for an object with e.g. the attribute city = "Berlin"?
Thanks for any suggestions!