I have the following data structure:
data = [
{\'site\': \'Stackoverflow\', \'id\': 1},
{\'site\': \'Superuser\', \'id\': 2},
{\'site\':
Lists absolutely require loops. That's what lists are for.
To avoid looping you have to avoid lists.
You want dictionaries of search keys and objects.
sites = dict( (d['site'],d) for d in data )
ids = dict( (d['id'],d] for d in data )
Now you can find the item associated with 'Superuser' with sites["Superuser"]
using a hashed lookup instead of a loop.