Building a library from scratch in Pyhton