class CustomStreamListener(tweepy.StreamListener):

    def check_ukcoords(self, status):
        if status.coordinates is not None:
            lat = status.coordinates['coordinates'][1]
lng = status.coordinates['coordinates'][0]
return 49.7 < lat < 58.8 and -6.1 < lng < 1.7

def check_uscoords(self, status):
    if status.coordinates is not None:
        lat = status.coordinates['coordinates'][1]
Using Tweepy to sort tweets by location