{ "info": { "author": "Gustavo Montamat", "author_email": "", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Intended Audience :: Developers", "License :: OSI Approved :: Apache Software License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries" ], "description": "# AdWords API Reporting in Python\n\nAn AdWords API large scale reporting tool written in Python. Reports are downloaded as plaintext files but connectivity\nwith a database engine such as MySQL, PostgreSQL, or MongoDB can be implemented\n[upon request](https://github.com/gmontamat/pyaw-reporting/issues).\n\n## Overview\n\n[pyaw-reporting](https://github.com/gmontamat/pyaw-reporting) is an open-source Python package suitable for large\nscale AdWords API reporting. Output reports are comma-separated values (CSV) plaintext files. By default, the package\nuses 10 threads to download reports simultaneously from different accounts. The number of threads used can be modified\nusing the `-n` parameter. It has been successfully tested using +100 threads making it useful for heavy load AdWords\nManager Accounts.\n\n### Supported AdWords API version\n\nThe latest API version supported by this package is\n[v201809](https://ads-developers.googleblog.com/2018/09/announcing-v201809-of-adwords-api.html) with\n[googleads 18.1.0](https://pypi.python.org/pypi/googleads). Older versions of the API are not supported, nor the newer\n[Google Ads API](https://developers.google.com/google-ads/api/docs/start).\n\n## Quick Start\n\n### Prerequisites\n\nYou will need Python 2.7 or 3.6+; this package will install [googleads](https://pypi.python.org/pypi/googleads) as a\ndependency. Note that that support for Python 2.7\n[will end in 2019](https://ads-developers.googleblog.com/2019/04/python-2-deprecation-in-ads-api-client.html). Using a\nvirtual environment is recommended to avoid running the package with `sudo`.\n\nAn access token [YAML file](#about-the-yaml-token) with the corresponding AdWords credentials is also necessary. By\ndefault, the package will look for `~/googleads.yaml` unless a different path is passed. The optional parameter\n**client\\_customer\\_id** must be included in this *YAML* file, you should enter your *AdWords Manager Account id*\n(formerly known as *MCC id*). This way, all accounts linked to the Manager Account will be retrieved. The sample file\n[example.yaml](awreporting/example.yaml) shows how your token should look like.\n\n[AWQL](https://developers.google.com/adwords/api/docs/guides/awql) queries could be either passed in the command line\nwith the `-a`/`--awql` parameter or stored in a plaintext file and passed via the `-q`/`--query` parameter. The module\nincludes a [sample query](awreporting/query.txt) which will retrieve clicks and impressions per ad for the\nlast 7 days. Refer to [Report Types](https://developers.google.com/adwords/api/docs/appendix/reports) and\n[The AdWords Query Language (AWQL)](https://developers.google.com/adwords/api/docs/guides/awql) for more information\nabout these queries.\n\n### Installation\n\n```bash\n$ pip install pyaw-reporting\n```\n\n### Usage\n\n#### Command line\n\n```\nusage: awreporting [-h] (-a AWQL | -q QUERY_FILE) [-t TOKEN] [-o OUTPUT]\n [-n NUM_THREAD] [-v]\n\nAwReporting - Large scale AdWords reporting tool in Python\n\noptional arguments:\n -h, --help show this help message and exit\n -t TOKEN, --token TOKEN specify AdWords YAML token path\n -o OUTPUT, --output OUTPUT define output file name\n -n NUM_THREAD, --num-thread NUM_THREAD set number of threads\n -v, --verbose display activity\n\nrequired arguments:\n -a AWQL, --awql AWQL pass AWQL query\n -q QUERY_FILE, --query-file QUERY_FILE ...or use a query file\n```\n\nFor example:\n\n```bash\n$ awreporting -t example.yaml -a \\\n \"SELECT ExternalCustomerId, CampaignId, AdGroupId, Id, Date, Clicks, Impressions \\\n FROM AD_PERFORMANCE_REPORT WHERE Impressions > 0 DURING LAST_7_DAYS\" \\\n -o adperformance.csv -n 100\n```\n\nOr, with a query file:\n\n```bash\n$ awreporting -t example.yaml -q query.txt -o adperformance.csv -n 100\n```\n\nIf you experience problems downloading reports, check the resulting logs in `awreporting.log` or use the\n`-v`/`--verbose` parameter to verify if something is wrong with your token or *AWQL* query.\n\n#### Code\n\nIf you prefer embedding this package in your own code, you could do like so:\n\n```python\nfrom awreporting import get_report\n\nquery = (\n \"SELECT ExternalCustomerId, CampaignId, AdGroupId, Id, Date, Clicks, Impressions \"\n \"FROM AD_PERFORMANCE_REPORT \"\n \"WHERE Impressions > 0 \"\n \"DURING LAST_7_DAYS\"\n)\nget_report('example.yaml', query, 'adperformance.csv', 100)\n```\n\n### About the YAML token\n\nThe example token file provided [example.yaml](awreporting/example.yaml) is not valid. Refer to\n[this guide](https://developers.google.com/adwords/api/docs/guides/first-api-call) if you are using the AdWords API for\nthe first time.\n\n### Disclaimer\n\nThis is neither an official [AdWords API](https://developers.google.com/adwords/api/) repository nor a clone of\n[AwReporting](https://github.com/googleads/aw-reporting). Consider using\n[AwReporting](https://github.com/googleads/aw-reporting) if you are a Java developer. This framework is both compatible\nwith Python 2.7 and Python 3.6+ but future releases will support Python 3.6+ only.\n\n### Troubleshooting\n\nWe recommend that you try the app with a small number of threads first (the default is 10) and increase the number\naccordingly. The AdWords server may complain when many API calls are made at the same time but those exceptions are\nhandled by the app. We have successfully obtained huge reports using 200 threads.\n\nWhen using this tool it might be necessary to enable a DNS cache in your system, such as\n[nscd](http://man7.org/linux/man-pages/man8/nscd.8.html). This should eliminate DNS lookup problems when repeatedly\ncalling the AdWords API server. For example, if you find many `URLError: ` in your logs, enable the DNS cache.\n\nIn some Linux systems `nscd` is not enabled by default but it can be started with:\n\n```\n# systemctl start nscd\n```\n\n## Useful links\n\n* https://developers.google.com/adwords/api/\n* https://github.com/googleads/googleads-python-lib\n* https://github.com/googleads/aw-reporting\n\n\n", "description_content_type": "text/markdown", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/gmontamat/pyaw-reporting", "keywords": "adwords adwords-api adwords-reports googleads awql", "license": "", "maintainer": "", "maintainer_email": "", "name": "pyaw-reporting", "package_url": "https://pypi.org/project/pyaw-reporting/", "platform": "", "project_url": "https://pypi.org/project/pyaw-reporting/", "project_urls": { "Homepage": "https://github.com/gmontamat/pyaw-reporting" }, "release_url": "https://pypi.org/project/pyaw-reporting/0.0.4/", "requires_dist": [ "googleads" ], "requires_python": "", "summary": "AdWords API Reporting in Python", "version": "0.0.4" }, "last_serial": 5215210, "releases": { "0.0.2": [ { "comment_text": "", "digests": { "md5": "008959b75c3b85c759b7a41c411a3efb", "sha256": "8659ec2e55c1786a77a0924a4d92cc9e4fdc9516ce2fdf1d4c8346f97d5ccfa1" }, "downloads": -1, "filename": "pyaw_reporting-0.0.2-py2-none-any.whl", "has_sig": false, "md5_digest": "008959b75c3b85c759b7a41c411a3efb", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 15483, "upload_time": "2019-02-02T17:28:40", "url": "https://files.pythonhosted.org/packages/c9/b7/dba6baa547544dd9cf6d367557e508478f4a4257d929f930b541c4017450/pyaw_reporting-0.0.2-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cd31e658ecf36feae49fdc60ef0b3375", "sha256": "bd4f2c5551d2970f9b487beaef24c4ba938eeee4aff18f470f7885633192664c" }, "downloads": -1, "filename": "pyaw_reporting-0.0.2-py3-none-any.whl", "has_sig": false, "md5_digest": "cd31e658ecf36feae49fdc60ef0b3375", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15483, "upload_time": "2019-02-02T17:20:42", "url": "https://files.pythonhosted.org/packages/cd/a4/90e6a5ab4dffba9ab64b56d210acf00d123be766536c2978f1d56177c299/pyaw_reporting-0.0.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1e267cad140b6343db01c7c4d19a3745", "sha256": "1cbb4b5df5e20e2f5194ba3648d814686c8bed4081ba006c1a577b3d48caac83" }, "downloads": -1, "filename": "pyaw-reporting-0.0.2.tar.gz", "has_sig": false, "md5_digest": "1e267cad140b6343db01c7c4d19a3745", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8637, "upload_time": "2019-02-02T17:20:44", "url": "https://files.pythonhosted.org/packages/38/9a/a971903f13db58e4c3b86d1e816a62765ee7dbb3c196ea06a934a22bc887/pyaw-reporting-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "79c4ab44248ea4b14d3f10aa87eddd18", "sha256": "6c18078430b28b3658bd95bd9420d71ca4cbfd222e529a91f8283b8164b5a1b2" }, "downloads": -1, "filename": "pyaw_reporting-0.0.3-py2-none-any.whl", "has_sig": false, "md5_digest": "79c4ab44248ea4b14d3f10aa87eddd18", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 15481, "upload_time": "2019-03-03T01:01:08", "url": "https://files.pythonhosted.org/packages/89/bd/4f4ef7092a4e29eb2cce8d7043ade880342144324677145ab63dbe3706b0/pyaw_reporting-0.0.3-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "35bc2973ed97f099e06ba0937b4aec97", "sha256": "e53e58ef5b6b982a456055c2cffebaa1734fa78f70879ad19e3f9ba73efad77b" }, "downloads": -1, "filename": "pyaw_reporting-0.0.3-py3-none-any.whl", "has_sig": false, "md5_digest": "35bc2973ed97f099e06ba0937b4aec97", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15479, "upload_time": "2019-03-03T00:58:21", "url": "https://files.pythonhosted.org/packages/f4/2d/1d59ac3d295c62d199947d3e9e44e04664f62165aad3faedae3c96880746/pyaw_reporting-0.0.3-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d1dac07d86d86894501695fc4d762a3f", "sha256": "c9facc68d96c415b24ea1067c9ef91373f60bf495fe9bba0ae453ef6ac5c2323" }, "downloads": -1, "filename": "pyaw-reporting-0.0.3.tar.gz", "has_sig": false, "md5_digest": "d1dac07d86d86894501695fc4d762a3f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8631, "upload_time": "2019-03-03T00:58:24", "url": "https://files.pythonhosted.org/packages/dc/e8/094a64fd6d23dd8b4ccae71af6fad12816e9770596e24d898de460277bf8/pyaw-reporting-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "21490cdd223bd5206948bcab16759325", "sha256": "6c66fa62074d449c7aef95d865d672d786701fd5af7d0db4fd2a948dcdfbd2ea" }, "downloads": -1, "filename": "pyaw_reporting-0.0.4-py2-none-any.whl", "has_sig": false, "md5_digest": "21490cdd223bd5206948bcab16759325", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 15530, "upload_time": "2019-05-02T03:21:16", "url": "https://files.pythonhosted.org/packages/1a/ee/e9afd44296f608dbecfaf00910294e1402b0700d7acb88ccc88e5441e914/pyaw_reporting-0.0.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "492015392eeaee965426dcc7a4efafd0", "sha256": "91338802ca52603d1bc4cc48b49fd070d01ef927822bd50d94dfbb230e344a70" }, "downloads": -1, "filename": "pyaw_reporting-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "492015392eeaee965426dcc7a4efafd0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15528, "upload_time": "2019-05-02T03:20:07", "url": "https://files.pythonhosted.org/packages/70/25/b528e0c82c61c3f8cc66890d02b59e8033fa454e9018f5073adc40041da2/pyaw_reporting-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "add75e71f555eef491d0df21d77e2e39", "sha256": "25de71debdb467def70f8e43f356949f4b64da1db5613a272e2bef1cff0f7e9f" }, "downloads": -1, "filename": "pyaw-reporting-0.0.4.tar.gz", "has_sig": false, "md5_digest": "add75e71f555eef491d0df21d77e2e39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8703, "upload_time": "2019-05-02T03:20:09", "url": "https://files.pythonhosted.org/packages/6d/b5/f436d6131f92732832686659048f07145f8f8a6b275500a75db68169533a/pyaw-reporting-0.0.4.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "21490cdd223bd5206948bcab16759325", "sha256": "6c66fa62074d449c7aef95d865d672d786701fd5af7d0db4fd2a948dcdfbd2ea" }, "downloads": -1, "filename": "pyaw_reporting-0.0.4-py2-none-any.whl", "has_sig": false, "md5_digest": "21490cdd223bd5206948bcab16759325", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 15530, "upload_time": "2019-05-02T03:21:16", "url": "https://files.pythonhosted.org/packages/1a/ee/e9afd44296f608dbecfaf00910294e1402b0700d7acb88ccc88e5441e914/pyaw_reporting-0.0.4-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "492015392eeaee965426dcc7a4efafd0", "sha256": "91338802ca52603d1bc4cc48b49fd070d01ef927822bd50d94dfbb230e344a70" }, "downloads": -1, "filename": "pyaw_reporting-0.0.4-py3-none-any.whl", "has_sig": false, "md5_digest": "492015392eeaee965426dcc7a4efafd0", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 15528, "upload_time": "2019-05-02T03:20:07", "url": "https://files.pythonhosted.org/packages/70/25/b528e0c82c61c3f8cc66890d02b59e8033fa454e9018f5073adc40041da2/pyaw_reporting-0.0.4-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "add75e71f555eef491d0df21d77e2e39", "sha256": "25de71debdb467def70f8e43f356949f4b64da1db5613a272e2bef1cff0f7e9f" }, "downloads": -1, "filename": "pyaw-reporting-0.0.4.tar.gz", "has_sig": false, "md5_digest": "add75e71f555eef491d0df21d77e2e39", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8703, "upload_time": "2019-05-02T03:20:09", "url": "https://files.pythonhosted.org/packages/6d/b5/f436d6131f92732832686659048f07145f8f8a6b275500a75db68169533a/pyaw-reporting-0.0.4.tar.gz" } ] }