added in convenience function py2rect