Python library

The Python API is in a very preliminary state so better not build on it yet!