{ "info": { "author": "Alex Hayes", "author_email": "alex@alution.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 4 - Beta", "Framework :: Django", "Framework :: Django :: 1.7", "Framework :: Django :: 1.8", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Operating System :: MacOS :: MacOS X", "Operating System :: Microsoft :: Windows", "Operating System :: OS Independent", "Operating System :: POSIX", "Programming Language :: Python", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: Implementation :: CPython", "Topic :: Software Development :: Object Brokering", "Topic :: System :: Distributed Computing" ], "description": "=====================\ndjango-google-adwords\n=====================\n\n`Django`_ modelling and helpers for the `Google Adwords API`_.\n\nUsing Celery_ to process tasks in the background the provided models include\nmethods to retrieve and store data for Accounts, Campaigns, Ad Groups and Ads to\nyour database for further processing.\n\nCurrently Google Adwords API version v201506_ is supported.\n\nInstallation\n============\n\nYou can install django-google-adwords either via the Python Package Index (PyPI)\nor from github.\n\nTo install using pip;\n\n.. code-block:: bash\n\n pip install django-google-adwords\n\nFrom github;\n\n.. code-block:: bash\n\n pip install git+https://github.com/alexhayes/django-google-adwords.git\n\n\nSettings\n========\n\n:code:`django-google-adwords` uses `django-appconf`_ to set default settings, of\nwhich there are quite a lot. Out of the box you only need to set the required\nsettings however you will most likely want to change the Celery queues settings.\n\n.. _`django-appconf`: http://django-appconf.readthedocs.org/en/latest/\n\n\nRequired\n--------\n\nYou must place the following in your django settings file.\n\n.. code-block:: python\n\n\tGOOGLEADWORDS_CLIENT_ID = 'your-adwords-client-id' # ie.. xyz123.apps.googleusercontent.com\n\tGOOGLEADWORDS_CLIENT_SECRET = 'your-adwords-client-secret' # xyz123xyz123xyz123xyz123\n\tGOOGLEADWORDS_REFRESH_TOKEN = 'your-adwords-refresh-token' # 1/xyz123xyz123xyz123xyz123xyz123xyz123xyz123x\n\tGOOGLEADWORDS_DEVELOPER_TOKEN = 'your-adwords-developer-token' # 1234567890\n\tGOOGLEADWORDS_CLIENT_CUSTOMER_ID = 'your-adwords-client-customer-id' # xyz123xyz123xyz123xyz1\n\nIf you don't know these values already you'll probably want to read the Google\nAdwords `OAuth 2.0 Authentication`_ documentation.\n\n.. _`OAuth 2.0 Authentication`: https://developers.google.com/adwords/api/docs/guides/authentication\n\n\nOther Settings\n--------------\n\nOther settings can be found in :code:`django_google_adwords.settings` and can be\noverridden by putting them in your settings file prepended with :code:`GOOGLEADWORDS_`.\n\n\nCelery\n------\n\nCelery_ installation and configuration is somewhat out of the scope of this\ndocument but in order to sync Google Adwords data into models you will need a\nworking Celery.\n\nEssentially the syncing of data is a two step process, as follows;\n\n1. Reports are downloaded from Adwords using the Celery queue specified in the \nsetting :code:`GOOGLEADWORDS_REPORT_RETRIEVAL_CELERY_QUEUE`.\n2. Downloaded reports are processed using the Celery queue specified in the \nsetting :code:`GOOGLEADWORDS_DATA_IMPORT_CELERY_QUEUE`. \n\nBy default the above two settings, along with :code:`GOOGLEADWORDS_HOUSEKEEPING_CELERY_QUEUE`\nare set to :code:`celery` however you may want to spilt these up with different\nworkers, as follows;\n\n.. code-block:: python\n\n\tGOOGLEADWORDS_REPORT_RETRIEVAL_CELERY_QUEUE = 'adwords_retrieval'\n\tGOOGLEADWORDS_DATA_IMPORT_CELERY_QUEUE = 'adwords_import'\n\tGOOGLEADWORDS_HOUSEKEEPING_CELERY_QUEUE = 'adwords_housekeeping'\n\nWith the above you could run the following workers;\n\n.. code-block:: python\n\n\tcelery worker --app myapp --queues adwords_retrieval &\n\tcelery worker --app myapp --queues adwords_import &\n\tcelery worker --app myapp --queues adwords_housekeeping &\n\n\n.. _`Celery`: http://www.celeryproject.org\n\n\nUsage\n=====\n\nStoring local data\n------------------\n\nThe provided models include methods to sync data from the Google Adwords API to\nthe local models so that it can be queried at a later stage.\n\n.. code-block:: python\n\n\taccount_id = [YOUR GOOGLE ADWORDS ACCOUNT ID]\n\taccount = Account.objects.create(account_id=account_id)\n\tresult = account.sync() # returns a celery AsyncResult\n\nDepending on the amount of data contained with your Adwords account the above\ncould take quite some time to populate! Advice is to monitor the celery task.\n\nYou can control what data is sync'd with the following settings:\n\n.. code-block:: python\n\n\tGOOGLEADWORDS_SYNC_ACCOUNT = True # Sync account data\n\tGOOGLEADWORDS_SYNC_CAMPAIGN = True # Sync campaign data\n\tGOOGLEADWORDS_SYNC_ADGROUP = True # Sync adgroup data\n\tGOOGLEADWORDS_SYNC_AD = False # Sync ad data - note this can take a LOOOONNNNG time if you have lots of ads... \n\nOnce you have created an account or have multiple accounts, you can, using\n`Celery Beat`_ have the accounts sync'd at regular intervals by setting the\n:code:`CELERYBEAT_SCHEDULE` similar to the following;\n\n.. code-block:: python\n\n\tfrom celery.schedules import crontab\n CELERYBEAT_SCHEDULE = {\n 'sync_google_adwords_data': {\n 'task': 'django_google_adwords.tasks.sync_chain',\n 'schedule': crontab(minute=5, hour=0),\n },\n }\n\n.. _`Celery Beat`: http://celery.readthedocs.org/en/latest/userguide/periodic-tasks.html\n\n\nPaged data\n----------\n\nTo use the API but not store data in the models you can page through yielded data\nwith the following;\n\n.. code-block:: python\n\n\tselector = {\n\t 'searchParameters': [\n\t {\n\t 'xsi_type': 'RelatedToQuerySearchParameter',\n\t 'queries': ['seo', 'adwords', 'adwords seo']\n\t },\n\t {\n\t 'xsi_type': 'LanguageSearchParameter',\n\t 'languages': [{'id': '1000'}]\n\t },\n\t {\n\t 'xsi_type': 'LocationSearchParameter',\n\t 'locations': [{'id': '2036'}]\n\t },\n\t ],\n\t 'ideaType': 'KEYWORD',\n\t 'requestType': 'IDEAS',\n\t 'requestedAttributeTypes': ['KEYWORD_TEXT', 'SEARCH_VOLUME'],\n\t}\n\t\n\tfor (data, selector) in paged_request('TargetingIdeaService', selector):\n\t print data\n\n\nGoogle Adwords API Versions\n===========================\n\nThe intention is to keep in sync with the latest available Google Adwords API\nversions - currently this is v201506_\n\nTo do this it's highly possible we'll need to break backwards compatibility as\nthe API can potentially do that.\n\n\nBackwards Incompatibility Changes\n=================================\n\nv0.6.0\n------\n\n- Changed setting :code:`GOOGLEADWORDS_START_FINISH_CELERY_QUEUE` to :code:`GOOGLEADWORDS_HOUSEKEEPING_CELERY_QUEUE`.\n- Removed :code:`Alert.sync_alerts()`, :code:`Alert.get_selector()` and task :code:`sync_alerts` as the services that these functions call have been discontinued in the Google API. The :code:`Alert` model remains in place so that existing alerts can be accessed if required.\n\nv0.4.0\n------\n\n- Now using Django 1.7 migrations.\n- Switched from money to djmoney (which itself uses py-moneyed).\n\n\nContributing\n============\n\nYou are encouraged to contribute - please fork and submit pull requests. To get\na development environment up you should be able to do the following;\n\n.. code-block:: bash\n\n\tgit clone https://bitbucket.org/alexhayes/django-google-adwords.git\n\tcd django-google-adwords\n\tpip instal -r requirements/default.txt\n\tpip instal -r requirements/test.txt\n\t./runtests.py\n\nAnd to run the full test suite, you can then run;\n\n.. code-block:: bash\n\n\ttox\n\nNote tox tests for Python 2.7, 3.3, 3.4 and PyPy for Django 1.7 and 1.8. \nYou'll need to consult the docs for installation of these Python versions\non your OS, on Ubuntu you can do the following;\n\n.. code-block:: bash\n\n\tsudo apt-get install python-software-properties\n\tsudo add-apt-repository ppa:fkrull/deadsnakes\n\tsudo apt-get update\n\tsudo apt-get install python2.7 python2.7-dev\n\tsudo apt-get install python3.3 python3.3-dev\n\tsudo apt-get install python3.4 python3.4-dev\n\tsudo apt-get install pypy pypy-dev\n\nNote that :code:`django-nose` issue `#133`_ and `#197`_ cause issues with some \ntests thus the reason for `alexhayes/django-nose`_ being used in the \n:code:`requirements/test.py` and :code:`requirements/test3.py`.\n\n.. _`#133`: https://github.com/django-nose/django-nose/issues/133\n.. _`#197`: https://github.com/django-nose/django-nose/issues/197\n.. _`alexhayes/django-nose`: https://github.com/alexhayes/django-nose \n\n\nThanks\n======\n\nThank-you to `roi.com.au`_ for supporting this project.\n\n.. _`roi.com.au`: http://roi.com.au\n\n\nAuthors\n=======\n\n- Jeremy Storer \n- Alex Hayes \n\n.. _`Django`: https://www.djangoproject.com/\n.. _`Google Adwords API`: https://developers.google.com/adwords/api/\n.. _`Celery`: http://www.celeryproject.org\n.. _v201506: https://developers.google.com/adwords/api/docs/reference/#v201506", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "http://github.com/alexhayes/django-cereal", "keywords": null, "license": "MIT", "maintainer": null, "maintainer_email": null, "name": "django-google-adwords", "package_url": "https://pypi.org/project/django-google-adwords/", "platform": "any", "project_url": "https://pypi.org/project/django-google-adwords/", "project_urls": { "Download": "UNKNOWN", "Homepage": "http://github.com/alexhayes/django-cereal" }, "release_url": "https://pypi.org/project/django-google-adwords/0.7.2/", "requires_dist": null, "requires_python": null, "summary": "Django modelling and helpers for the Google Adwords API.", "version": "0.7.2" }, "last_serial": 1650615, "releases": { "0.6.0": [], "0.6.1": [ { "comment_text": "", "digests": { "md5": "9bc4006ff11716dedc08dd1f60f1318e", "sha256": "d67373675044eca0123b636d33310f88d13319a5fc06739991c45f388a68f312" }, "downloads": -1, "filename": "django-google-adwords-0.6.1.tar.gz", "has_sig": false, "md5_digest": "9bc4006ff11716dedc08dd1f60f1318e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33639, "upload_time": "2015-06-25T03:48:50", "url": "https://files.pythonhosted.org/packages/d5/4c/efdb9061160579535c572432569efe6f860b7944d9e63728588ba93819b9/django-google-adwords-0.6.1.tar.gz" } ], "0.6.2": [ { "comment_text": "", "digests": { "md5": "da7a0461815bae27d56ce801b6cd51c0", "sha256": "8de6385e3521733a9e67e243978784030a1110bee37859b3a88207d879d3f673" }, "downloads": -1, "filename": "django-google-adwords-0.6.2.tar.gz", "has_sig": false, "md5_digest": "da7a0461815bae27d56ce801b6cd51c0", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33697, "upload_time": "2015-06-25T04:49:18", "url": "https://files.pythonhosted.org/packages/54/0f/fab27cf5c203bc4334449eb1b70a1196f10cdd6e94a59cc909e6e285db88/django-google-adwords-0.6.2.tar.gz" } ], "0.6.3": [ { "comment_text": "", "digests": { "md5": "5f9ccac6bdda5b27bfdbc94c19276e84", "sha256": "5906a4fd6ad03e12d97edef4dd07b83d0694847e6351086d78502777ce9b743f" }, "downloads": -1, "filename": "django-google-adwords-0.6.3.tar.gz", "has_sig": false, "md5_digest": "5f9ccac6bdda5b27bfdbc94c19276e84", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33721, "upload_time": "2015-06-25T05:44:05", "url": "https://files.pythonhosted.org/packages/6c/f7/e1de24202dd371398fd901bd0c2bb0c25715eda164289fcd50b0aa612f31/django-google-adwords-0.6.3.tar.gz" } ], "0.6.4": [ { "comment_text": "", "digests": { "md5": "31582f3020096ae20b18863257561bb8", "sha256": "a0fd8b3c8a97530f8f71f61b910e705e769509cee369ce718f966cb19d57dacd" }, "downloads": -1, "filename": "django-google-adwords-0.6.4.tar.gz", "has_sig": false, "md5_digest": "31582f3020096ae20b18863257561bb8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33928, "upload_time": "2015-06-29T03:26:17", "url": "https://files.pythonhosted.org/packages/1f/cb/b6617bd0603fad1e1ddb4acb44ceb3e32a3bdcba3ceeee72a025cccd40e2/django-google-adwords-0.6.4.tar.gz" } ], "0.7.0": [ { "comment_text": "", "digests": { "md5": "0b4787733050730d4ae73c705807dad3", "sha256": "96c906870c219d90a82dfbbc94c8db2a77ada1aaced08ff0b41444bf80d25739" }, "downloads": -1, "filename": "django-google-adwords-0.7.0.tar.gz", "has_sig": false, "md5_digest": "0b4787733050730d4ae73c705807dad3", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33855, "upload_time": "2015-06-30T04:41:54", "url": "https://files.pythonhosted.org/packages/61/b3/e42de120019fe1dc0540e4c66f91e39e22ab0e58301f1625446d69a88b33/django-google-adwords-0.7.0.tar.gz" } ], "0.7.1": [ { "comment_text": "", "digests": { "md5": "6ad0ce2c5047872ea208d80d45c1af14", "sha256": "eb086ccf2835c26e5a5f8f1fe1327a3a17dd420e440c46b93838152d4a55c04a" }, "downloads": -1, "filename": "django-google-adwords-0.7.1.tar.gz", "has_sig": false, "md5_digest": "6ad0ce2c5047872ea208d80d45c1af14", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33879, "upload_time": "2015-07-01T03:42:00", "url": "https://files.pythonhosted.org/packages/32/f4/8897bb978635374c073f15e02c115c1dd67291f3ad067b74eb7146e1fe45/django-google-adwords-0.7.1.tar.gz" } ], "0.7.2": [ { "comment_text": "", "digests": { "md5": "db7193205ba390eb152c18f0336904da", "sha256": "580462f666944bc4400460aec00436b013408cb43a0f30f91213f47f80f86859" }, "downloads": -1, "filename": "django-google-adwords-0.7.2.tar.gz", "has_sig": false, "md5_digest": "db7193205ba390eb152c18f0336904da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33912, "upload_time": "2015-07-26T22:25:28", "url": "https://files.pythonhosted.org/packages/93/69/5c8cf698874d75f288253e840a3c4946fe66306f638fb52e9b64775d2931/django-google-adwords-0.7.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "db7193205ba390eb152c18f0336904da", "sha256": "580462f666944bc4400460aec00436b013408cb43a0f30f91213f47f80f86859" }, "downloads": -1, "filename": "django-google-adwords-0.7.2.tar.gz", "has_sig": false, "md5_digest": "db7193205ba390eb152c18f0336904da", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 33912, "upload_time": "2015-07-26T22:25:28", "url": "https://files.pythonhosted.org/packages/93/69/5c8cf698874d75f288253e840a3c4946fe66306f638fb52e9b64775d2931/django-google-adwords-0.7.2.tar.gz" } ] }