This seems like something that should be in pyqi. Thoughts on that?