Having 401 Unauthorized Error while trying to connect to App analytics

Hi

I am trying to connect to App analytics - Metrics Section from Python script. I want to download the csv file using Python script. But i am not able to make successful connection. I am having 401 status_code of my request. Can anyone help me please.