Instead of using pandas to filter items, try to write better graphql queries (e.g., exclusions by location or group names.) Possibly pass params to queries wrapped in python. Or look for a library that takes care of that.