{"id":13849418,"url":"https://github.com/googleads/googleads-python-lib","last_synced_at":"2025-05-14T09:11:22.775Z","repository":{"id":14984933,"uuid":"17710133","full_name":"googleads/googleads-python-lib","owner":"googleads","description":"The Python client library for Google's Ads APIs","archived":false,"fork":false,"pushed_at":"2025-02-20T17:38:54.000Z","size":6278,"stargazers_count":700,"open_issues_count":37,"forks_count":975,"subscribers_count":81,"default_branch":"main","last_synced_at":"2025-04-13T15:54:41.466Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/googleads.png","metadata":{"files":{"readme":"README.md","changelog":"ChangeLog","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2014-03-13T13:00:34.000Z","updated_at":"2025-04-10T21:55:02.000Z","dependencies_parsed_at":"2024-05-21T21:47:18.303Z","dependency_job_id":"50af9e1d-84d7-42ba-8bb9-4134eb681496","html_url":"https://github.com/googleads/googleads-python-lib","commit_stats":{"total_commits":229,"total_committers":30,"mean_commits":7.633333333333334,"dds":0.7729257641921398,"last_synced_commit":"d5582cd0af0038fe0849d7310783797c2f9c6338"},"previous_names":[],"tags_count":103,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fgoogleads-python-lib","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fgoogleads-python-lib/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fgoogleads-python-lib/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/googleads%2Fgoogleads-python-lib/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/googleads","download_url":"https://codeload.github.com/googleads/googleads-python-lib/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254110374,"owners_count":22016391,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-08-04T19:01:17.316Z","updated_at":"2025-05-14T09:11:22.751Z","avatar_url":"https://github.com/googleads.png","language":"Python","funding_links":[],"categories":["Python"],"sub_categories":[],"readme":"# The Google Ad Manager SOAP API Python client library\n\nThis client library simplifies accessing the Google Ad Manager SOAP API.\nThe library provides easy ways to store your authentication and\ncreate SOAP web service clients. It also contains example code to help you get\nstarted integrating with our APIs.\n\n## Getting started\n1. Download and install the library\n\n   *[setuptools](https://pypi.python.org/pypi/setuptools) is a pre-requisite\n   for installing the googleads library*\n\n   It is recommended that you install the library and its dependencies from\n   PyPI using [pip](https://pip.pypa.io/en/stable/installing/). This can be\n   accomplished with a single command:\n\n   `$ pip install googleads`\n\n   As an alternative, you can\n   [download the library as a tarball](https://pypi.python.org/pypi/googleads).\n   To start the installation, navigate to the directory that contains your\n   downloaded unzipped client library and run the \"setup.py\" script as follows:\n\n   `$ python setup.py build install`\n\n2. Copy the [googleads.yaml](https://github.com/googleads/googleads-python-lib/blob/main/googleads.yaml)\n   file to your home directory.\n\n   This will be used to store credentials and other settings that can be loaded\n   to initialize a client.\n\n3. Set up your OAuth2 credentials\n\n   The Ad Manager API uses [OAuth2](http://oauth.net/2/) as the authentication\n4. mechanism. Follow the appropriate guide below based on your use case.\n\n   **If you're accessing an API using your own credentials...**\n\n   * [Using Ad Manager](https://github.com/googleads/googleads-python-lib/wiki/API-access-using-own-credentials-(server-to-server-flow))\n\n   **If you're accessing an API on behalf of clients...**\n\n   * [Developing a web application (Ad Manager)](https://github.com/googleads/googleads-python-lib/wiki/API-access-on-behalf-of-your-clients-(web-flow))\n\n#### Where can I find samples?\n\nYou can find code examples for the latest versions of Ad Manager on the\n[releases](https://github.com/googleads/googleads-python-lib/releases) page.\n\nAlternatively, you can find\n[Ad Manager](https://github.com/googleads/googleads-python-lib/tree/main/examples/ad_manager)\nsamples in the examples directory of this repository.\n\n#### Caching authentication information\n\nIt is possible to cache your API authentication information. The library\nincludes a sample file showing how to do this named `googleads.yaml`. Fill\nin the fields for the API and features you plan to use. The library's\n`LoadFromStorage` methods default to looking for a file with this name in your\nhome directory, but you can pass in a path to any file with the correct yaml\ncontents.\n\n```python\n# Use the default location - your home directory:\nad_manager_client = ad_manager.AdManagerClient.LoadFromStorage()\n\n# Alternatively, pass in the location of the file:\nad_manager_client = ad_manager.AdManagerClient.LoadFromStorage('C:\\My\\Directory\\googleads.yaml')\n```\n\n## Where do I submit bug reports and/or feature requests?\n\nIf you have issues directly related to the client library, use the [issue\ntracker](https://github.com/googleads/googleads-python-lib/issues).\n\n\nIf you have issues pertaining to a specific API, use the product support forums:\n\n* [Ad Manager](https://groups.google.com/forum/#!forum/google-doubleclick-for-publishers-api)\n\n\n## How do I log SOAP interactions?\nThe library uses Python's built in logging framework. You can specify your\nconfiguration via the configuration file; see [googleads.yaml](https://github.com/googleads/googleads-python-lib/blob/main/googleads.yaml)\nfor an example.\n\nAlternatively, you can manually specify your logging configuration. For example,\nif you want to log your SOAP interactions to stdout, and you are using the Zeep soap library, you\ncan do the following:\n```python\nlogging.basicConfig(level=logging.INFO, format=googleads.util.LOGGER_FORMAT)\nlogging.getLogger('googleads.soap').setLevel(logging.DEBUG)\n```\nIf you wish to log to a file, you'll need to attach a log handler to this source\nwhich is configured to write the output to a file.\n\n\n## How do I disable log filters?\nThe zeep plugin used for logging strips sensitive data from its output. If you would like this data\nincluded in logs, you'll need to implement your own simple logging plugin. For example:\n```python\nclass DangerousZeepLogger(zeep.Plugin):\n  def ingress(self, envelope, http_headers, operation):\n    logging.debug('Incoming response: \\n%s', etree.tostring(envelope, pretty_print=True))\n    return envelope, http_headers\n\n  def egress(self, envelope, http_headers, operation, binding_options):\n    logging.debug('Incoming response: \\n%s', etree.tostring(envelope, pretty_print=True))\n    return envelope, http_headers\n\nad_manager_client.zeep_client.plugins.append(DangerousZeepLogger())\n```\n\n## How can I configure or disable caching?\n\nBy default, clients are cached because reading and digesting the WSDL\ncan be expensive. However, the default caching method requires permission to\naccess a local file system that may not be available in certain hosting\nenvironments such as App Engine.\n\nYou can pass an implementation of `zeep.cache.Base` to the `AdManagerClient`\ninitializer to modify the default caching behavior.\n\nFor example, configuring a different location and duration of the cache file\nwith zeep\n```python\ndoc_cache = zeep.cache.SqliteCache(path=cache_path)\nad_manager_client = ad_manager.AdManagerClient(\n  oauth2_client, application_name, network_code=network_code, cache=doc_cache)\n```\n\nYou can also disable caching in similar fashion with zeep\n```python\nad_manager_client = ad_manager.AdManagerClient(\n  oauth2_client, application_name, network_code=network_code,\n  cache=googleads.common.ZeepServiceProxy.NO_CACHE)\n```\n\n## Requirements\n\n### Python Versions\n\nThis library only supports Python 3.7+.\n\n### External Dependencies:\n\n    - httplib2             -- https://pypi.python.org/pypi/httplib2/\n    - oauth2client         -- https://pypi.python.org/pypi/oauth2client/\n    - pysocks              -- https://pypi.python.org/pypi/PySocks/\n    - pytz                 -- https://pypi.python.org/pypi/pytz\n    - pyYAML               -- https://pypi.python.org/pypi/pyYAML/\n    - xmltodict            -- https://pypi.python.org/pypi/xmltodict/\n    - zeep                 -- https://pypi.python.org/pypi/zeep\n    - mock                 -- https://pypi.python.org/pypi/mock\n                              (only needed to run unit tests)\n    - pyfakefs             -- https://pypi.python.org/pypi/pyfakefs\n                              (only needed to run unit tests)\n\n\n## Authors:\n    Mark Saniscalchi\n    David Wihl\n    Ben Karl\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleads%2Fgoogleads-python-lib","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgoogleads%2Fgoogleads-python-lib","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgoogleads%2Fgoogleads-python-lib/lists"}