Create library.py

Moving the library.py from another branch that is being pruned