Best Practices for working with reports?

52 views
Skip to first unread message

Nellle Rickchards

unread,
May 8, 2018, 4:37:18 PM5/8/18
to AdWords API and Google Ads API Forum
Hello,

I'm working with GetReportDownloader and following some of the examples Google has provided (https://developers.google.com/adwords/api/docs/samples/python/reporting#download-criteria-report-as-a-stream-with-awql).

Currently I do this:

Sctipt 1:
- Download adwords report to a CSV file

Script 2:
- Open CSV file as a pandas dataframe
- Does some calculations/analysis using the dataframe

Is this the right way of doing it? Is it possible to save the report directly to a pandas dataframe or other python datatype instead of downloading it to my local system? 

Luis Xander Talag (AdWords API Team)

unread,
May 9, 2018, 1:38:15 AM5/9/18
to AdWords API and Google Ads API Forum
Hi Nellle,

I believe the steps you are doing in downloading the report is correct. However, I am not familiar with pandas dataframe as we do not support other third party application integration with the AdWords API. Currently, these are the supported download formats that you could use in downloading reports. Also, you could use the getAsString() method to retrieve the data as string representation then you could parse the data. After parsing the data, you could then create a method on your end that could save those data in your pandas dataframe.

Thanks and regards,
Luis
AdWords API Team

Peter Bowen

unread,
May 9, 2018, 7:29:14 AM5/9/18
to AdWords API and Google Ads API Forum
Hi.

I think you're doing it the right way by separating the scripts. That's good programming practice.

I don't know how good python is at freeing memory but if you're handling a really big report it might be better to keep the get report and process report functions separate as you have them to avoid timeout or memory out errors.
Reply all
Reply to author
Forward
0 new messages