Update stockpi.py

Added documentation to the code.