rewriting getItems to py