Rough first draft of a Python wrapper.