README.md

The googleads Python client library

Note: DoubleClick for Publishers was recently renamed to Google Ad Manager, and this library
was modified to follow suit. Please see the migration guide
for more details.

This client library simplifies accessing Google's SOAP Ads APIs - AdWords,
and DoubleClick for Publishers. The library provides easy ways to store your
authentication and create SOAP web service clients. It also contains example
code to help you get started integrating with our APIs.

NOTE: As of v20.0.0 this library is not compatible with Python versions less than Python 3.6.
Also suds is no longer supported in this library, zeep is now the only supported SOAP client.

Getting started

It is recommended that you install the library and its dependencies from
PyPI using pip. This can be
accomplished with a single command:

$ pip install googleads

As an alternative, you can
download the library as a tarball.
To start the installation, navigate to the directory that contains your
downloaded unzipped client library and run the "setup.py" script as follows:

Where can I find the pydocs?

Caching authentication information

It is possible to cache your API authentication information. The library
includes a sample file showing how to do this named googleads.yaml. Fill
in the fields for the API and features you plan to use. The library's
LoadFromStorage methods default to looking for a file with this name in your
home directory, but you can pass in a path to any file with the correct yaml
contents.

# Use the default location - your home directory:adwords_client=adwords.AdWordsClient.LoadFromStorage()
# Alternatively, pass in the location of the file:ad_manager_client=ad_manager.AdManagerClient.LoadFromStorage('C:\My\Directory\googleads.yaml')

How can I configure or disable caching?

By default, clients are cached because reading and digesting the WSDL
can be expensive. However, the default caching method requires permission to
access a local file system that may not be available in certain hosting
environments such as App Engine.

You can pass an implementation of zeep.cache.Base to the AdWordsClient or
AdManagerClient initializer to modify the default caching behavior.

For example, configuring a different location and duration of the cache file with zeep