I have gotten the following error:
type object \'datetime.datetime\' has no attribute \'datetime\'
On the following line:
You should use
date = datetime(int(year), int(month), 1)
Or change
from datetime import datetime
to
import datetime