update to use typing, docstrings, click, unittest, and pydantic