How to access history files through python for purposes of back testing a trading bot

How can I download/access history files for a period up to 2 years or more, from a python algorithm, for the purposes of back testing a trading bot?