Work in progess. More Python tests before reworking query ranges.