11# The googleads Python client library
22
3- This client library simplifies accessing Google's SOAP Ads APIs - AdWords,
4- and DoubleClick for Publishers. The library provides easy ways to store your
5- authentication and create SOAP web service clients. It also contains example
6- code to help you get started integrating with our APIs.
7-
8- > ** The Google AdWords API will [ sunset on April 27, 2022] ( https://ads-developers.googleblog.com/2021/04/upgrade-to-google-ads-api-from-adwords.html ) .
9- > Upgrade to the [ Google Ads API] ( https://developers.google.com/google-ads/api/docs/client-libs ) .**
3+ This client library simplifies accessing Google's SOAP Ads APIs - such as
4+ Ad Manager. The library provides easy ways to store your authentication and
5+ create SOAP web service clients. It also contains example code to help you get
6+ started integrating with our APIs.
107
118## Getting started
1291 . Download and install the library
@@ -27,40 +24,34 @@ code to help you get started integrating with our APIs.
2724
2825 ` $ python setup.py build install `
2926
30- 1 . Copy the [ googleads.yaml] ( https://github.com/googleads/googleads-python-lib/blob/main/googleads.yaml )
27+ 2 . Copy the [ googleads.yaml] ( https://github.com/googleads/googleads-python-lib/blob/main/googleads.yaml )
3128 file to your home directory.
3229
3330 This will be used to store credentials and other settings that can be loaded
3431 to initialize a client.
3532
36- 1 . Set up your OAuth2 credentials
33+ 3 . Set up your OAuth2 credentials
3734
38- The AdWords and DoubleClick for Publishers APIs use
39- [ OAuth2] ( http://oauth.net/2/ ) as the authentication mechanism. Follow the
40- appropriate guide below based on your use case.
35+ The Ad Manager API uses [ OAuth2] ( http://oauth.net/2/ ) as the authentication
36+ 4 . mechanism. Follow the appropriate guide below based on your use case.
4137
4238 ** If you're accessing an API using your own credentials...**
4339
44- * [ Using AdWords] ( https://github.com/googleads/googleads-python-lib/wiki/API-access-using-own-credentials-(installed-application-flow) )
4540 * [ Using Ad Manager] ( https://github.com/googleads/googleads-python-lib/wiki/API-access-using-own-credentials-(server-to-server-flow) )
4641
4742 ** If you're accessing an API on behalf of clients...**
4843
49- * [ Developing a web application (AdWords or Ad Manager)] ( https://github.com/googleads/googleads-python-lib/wiki/API-access-on-behalf-of-your-clients-(web-flow) )
44+ * [ Developing a web application (Ad Manager)] ( https://github.com/googleads/googleads-python-lib/wiki/API-access-on-behalf-of-your-clients-(web-flow) )
5045
5146#### Where can I find samples?
5247
53- You can find code examples for the latest versions of AdWords or Ad Manager on the
48+ You can find code examples for the latest versions of Ad Manager on the
5449[ releases] ( https://github.com/googleads/googleads-python-lib/releases ) page.
5550
56- Alternatively, you can find [ AdWords ] ( https://github.com/googleads/googleads-python-lib/tree/main/examples/adwords )
57- or [ Ad Manager] ( https://github.com/googleads/googleads-python-lib/tree/main/examples/ad_manager )
51+ Alternatively, you can find
52+ [ Ad Manager] ( https://github.com/googleads/googleads-python-lib/tree/main/examples/ad_manager )
5853samples in the examples directory of this repository.
5954
60- #### Where can I find the pydocs?
61-
62- Our pydocs can be found [ here] ( http://googleads.github.io/googleads-python-lib ) .
63-
6455#### Caching authentication information
6556
6657It is possible to cache your API authentication information. The library
@@ -72,21 +63,12 @@ contents.
7263
7364``` python
7465# Use the default location - your home directory:
75- adwords_client = adwords.AdWordsClient .LoadFromStorage()
66+ ad_manager_client = ad_manager.AdManagerClient .LoadFromStorage()
7667
7768# Alternatively, pass in the location of the file:
7869ad_manager_client = ad_manager.AdManagerClient.LoadFromStorage(' C:\My\Directory\googleads.yaml' )
7970```
8071
81- #### How do I change the Client Customer Id at runtime?
82- You can change the Client Customer Id with the following:
83-
84- ```
85- adwords_client = AdWordsClient.LoadFromStorage()
86- adwords_client.SetClientCustomerId('my_client_customer_id')
87- ```
88-
89-
9072## Where do I submit bug reports and/or feature requests?
9173
9274If you have issues directly related to the client library, use the [ issue
@@ -95,7 +77,6 @@ tracker](https://github.com/googleads/googleads-python-lib/issues).
9577
9678If you have issues pertaining to a specific API, use the product support forums:
9779
98- * [ AdWords] ( https://groups.google.com/forum/#!forum/adwords-api )
9980* [ Ad Manager] ( https://groups.google.com/forum/#!forum/google-doubleclick-for-publishers-api )
10081
10182
@@ -128,7 +109,7 @@ class DangerousZeepLogger(zeep.Plugin):
128109 logging.debug(' Incoming response: \n %s ' , etree.tostring(envelope, pretty_print = True ))
129110 return envelope, http_headers
130111
131- adwords_client .zeep_client.plugins.append(DangerousZeepLogger())
112+ ad_manager_client .zeep_client.plugins.append(DangerousZeepLogger())
132113```
133114
134115## How can I configure or disable caching?
@@ -138,22 +119,21 @@ can be expensive. However, the default caching method requires permission to
138119access a local file system that may not be available in certain hosting
139120environments such as App Engine.
140121
141- You can pass an implementation of ` zeep.cache.Base ` to the ` AdWordsClient ` or
142- ` AdManagerClient ` initializer to modify the default caching behavior.
122+ You can pass an implementation of ` zeep.cache.Base ` to the ` AdManagerClient `
123+ initializer to modify the default caching behavior.
143124
144- For example, configuring a different location and duration of the cache file with zeep
125+ For example, configuring a different location and duration of the cache file
126+ with zeep
145127``` python
146128doc_cache = zeep.cache.SqliteCache(path = cache_path)
147- adwords_client = adwords.AdWordsClient(
148- developer_token, oauth2_client, user_agent,
149- client_customer_id = client_customer_id, cache = doc_cache)
129+ ad_manager_client = ad_manager.AdManagerClient(
130+ oauth2_client, application_name, network_code = network_code, cache = doc_cache)
150131```
151132
152133You can also disable caching in similar fashion with zeep
153134``` python
154- adwords_client = adwords.AdWordsClient(
155- developer_token, oauth2_client, user_agent,
156- client_customer_id = client_customer_id,
135+ ad_manager_client = ad_manager.AdManagerClient(
136+ oauth2_client, application_name, network_code = network_code,
157137 cache = googleads.common.ZeepServiceProxy.NO_CACHE )
158138```
159139
0 commit comments