With the latest version update of the civicpy package (v2.0.0) incompatibilities with the script query_civic_expr.py arose. Some vocabulary seems to be updated (DOES_NOT_SUPPORT vs. DOES NOT SUPPORT), and data types changed (INT vs. STRING creating errors like AttributeError: 'int' object has no attribute 'strip').
A new script using the civicutils package is probably the best approach.