Faceted query emailer in python