{ "info": { "author": "David Lin", "author_email": "david.lin@effectivemeasure.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "DDP API python client\n---------------------\n\nThis is a python client library for the OAuth2 DDP API. Currently the following services are supported:\n\n* UserListService\n* UserListClientService\n\n\nInstallation\n------------\n\n::\n\n pip install ddpclient\n\n\nTest\n----\n\n::\n\n python setup.py test\n\nDeploy\n----\nUpdate the version and dependencies in `setup.py` and then:\n\n::\n\n python setup.py sdist upload\n\n\nRequirement\n-----------\n\n1. OAuth client ID and OAuth client secret\n\n DDP API uses OAuth 2.0 for authorization, to authorize the DDP API,\n you must first create a Client ID and a Client Secret. Visit the\n `Developer Console`_ to create a project and a OAuth client with\n credentials.\n\n You will use the client ID and secret to authorize DDP API.\n\n2. AdWards Client `Customer ID`_\n\n A unique three-part number that\u2019s assigned to each AdWords account,\n listed at the top of every page in your account.\n\n You can set it as an environment variable `DDP_CLIENT_CUSTOMER_ID`. Or you can pass the ID into the `Client` class constructor (details below).\n\nCommands\n--------\n\nWhen installed, the DDP API client provide two command for authorizing\nyour application access to a DDP account.\n\nThese commands are provided to help quickly getting access to the DDP API to run the examples.\nIt stores crendentials in a file named ``.ddp_credentials``.\nIf you are using Flask or Django, consider using the ``oauth2client.contrib.flask_util`` and ``oauth2client.contrib.django_util``\n\nGenerate Authorize URL\n^^^^^^^^^^^^^^^^^^^^^^\n\nThe ``ddp_authorize_url`` command expect the OAuth client id and client\nsecret as parameter and generate a URL for getting a AuthCode\n\n::\n\n $ ddp_authorize_url\n usage: ddp_authorize_url [client_id client_secret]\n\nAuthorizing\n^^^^^^^^^^^\n\nThe ``ddp_authorize`` command expect the OAuth client id, secrete and\nthe AuthCode obtained by using the ``ddp_authorize_url`` URL\n\n::\n\n $ ddp_authorize\n usage: ddp_authorize [client_id client_secret auth_code]\n\nOnce this is done, a file ``.ddp_credentials`` is created and store the\nresulting redentials. The credentials from this file will be used from\nthen on.\n\nUsage\n-----\n\nGet UserList example:\n^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n from ddpclient import UserListSelector, Client, Auth\n\n credentials = Auth().get_credentials()\n api_client = Client(credentials)\n selector = UserListSelector(). \\\n select_fields('Id', 'Size'). \\\n filter_by('Status', 'CLOSED'). \\\n order_by('Id', True). \\\n at_page(1, 3)\n response = api_client.get(selector)\n\n print response\n\n # (UserListPage){\n # totalNumEntries = 108\n # Page.Type = \"UserListPage\"\n # entries[] =\n # (BasicUserList){\n # id = 978704062\n # isReadOnly = False\n # name = \"Name one\"\n # size = 0\n # sizeRange = \"LESS_THAN_FIVE_HUNDRED\"\n # listType = \"REMARKETING\"\n # UserList.Type = \"BasicUserList\"\n # },\n # (BasicUserList){\n # id = 178703382\n # isReadOnly = False\n # name = \"Name two\"\n # size = 0\n # sizeRange = \"LESS_THAN_FIVE_HUNDRED\"\n # listType = \"REMARKETING\"\n # UserList.Type = \"BasicUserList\"\n # },\n # (BasicUserList){\n # id = 138700763\n # isReadOnly = False\n # name = \"Name three\"\n # size = 0\n # sizeRange = \"LESS_THAN_FIVE_HUNDRED\"\n # listType = \"REMARKETING\"\n # UserList.Type = \"BasicUserList\"\n # },\n # }\n\n\nAdd UserList example:\n^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n from ddpclient import UserListSelector, Client, Auth\n\n credentials = Auth().get_credentials()\n api_client = Client(credentials)\n\n new_user_list = api_client.create_empty_user_list()\n new_user_list.name = 'TEST'\n new_user_list.description = 'TEST Description'\n new_user_list.status = 'CLOSED'\n new_user_list.integrationCode = '123'\n new_user_list.accountUserListStatus = 'INACTIVE'\n\n response = api_client.add(new_user_list)\n\n print response\n\n\n # (UserListReturnValue){\n # ListReturnValue.Type = \"UserListReturnValue\"\n # value[] =\n # (BasicUserList){\n # id = 12345678\n # isReadOnly = False\n # name = \"TEST\"\n # description = \"TEST Description\"\n # status = \"CLOSED\"\n # integrationCode = \"123\"\n # accessReason = \"OWNED\"\n # accountUserListStatus = \"INACTIVE\"\n # membershipLifeSpan = 30\n # listType = \"REMARKETING\"\n # isEligibleForSearch = True\n # isEligibleForDisplay = True\n # UserList.Type = \"BasicUserList\"\n # },\n # }\n\n\nUpdate UserList example:\n^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n from ddpclient import UserListSelector, Client, Auth\n\n credentials = Auth().get_credentials()\n api_client = Client(credentials)\n\n new_user_list = api_client.create_empty_user_list()\n new_user_list.id = 12345678\n new_user_list.description = 'TEST Description'\n\n response = api_client.set(new_user_list)\n\n print response\n\n # (UserListReturnValue){\n # ListReturnValue.Type = \"UserListReturnValue\"\n # value[] =\n # (BasicUserList){\n # id = 12345678\n # isReadOnly = False\n # name = \"TEST Updated Name\"\n # description = \"TEST Description\"\n # status = \"CLOSED\"\n # integrationCode = \"123\"\n # accessReason = \"OWNED\"\n # accountUserListStatus = \"INACTIVE\"\n # membershipLifeSpan = 30\n # listType = \"REMARKETING\"\n # isEligibleForSearch = True\n # isEligibleForDisplay = True\n # UserList.Type = \"BasicUserList\"\n # },\n # }\n\n\nRemove UserList example:\n^^^^^^^^^^^^^^^^^^^^^^^^\n\n::\n\n from ddpclient import UserListSelector, Client, Auth\n\n credentials = Auth().get_credentials()\n api_client = Client(credentials)\n\n new_user_list = api_client.create_empty_user_list()\n new_user_list.id = 395803975\n\n response = api_client.remove(new_user_list)\n\n print response\n\n # suds.WebFault: Server raised fault: '[OperatorError.OPERATOR_NOT_SUPPORTED @ operations[0]]'\n # Note: UserListService does not support deleting user list, this code servers as example of 'remove' operations\n\n\n\nClasses\n-------\n\n``Auth``\n^^^^^^^^\n\n``Auth`` class can be used to generate URL (``authorize_url``) for user giving authorization:\n\n::\n\n Auth().authorize_url(client_id, client_secret)\n\n\n\n``Auth`` also accept a auth code and obtain credentials after user having visited the above URL and granted the authorization to you application.\nThe credentials object returned will be saved into a ``storage`` object.\n\n::\n\n Auth().authorize(client_id, client_secret, auth_code)\n\n\nWhen the ``authorize`` method is done, by default ``Auth`` save the credentials object ( ``oauth2client.client.OAuth2Credentials``)\ninto a file (``.ddp_credentials``) using ``oauth2client.file.Storage``. Once saved, this credential can be retrieved by:\n\n::\n\n credentials = Auth().get_credentials()\n\n\nSaving credentials into a file for later retrieval is very simple but does not work for environments like Heroku.\nYou might want to save the credentials object into a database so that the credentials can survive between deployments.\nThe ``Auth`` constructor can accept a custom storage object with ``put`` and ``get`` methods defined.\nUsing custom storage object can save/retrieve credentials object into/from a database, for example.\n\n::\n\n storage = MyDBStorage()\n auth = Auth(storage)\n\n auth.authorize(client_id, client_secret, auth_code)\n credentials = auth.get_credentials()\n\n\n``Client``\n^^^^^^^^^^\n\n``Client`` manages SOAP services. It requires an ``oauth2client.client.OAuth2Credentials`` object ( most likely retrieved by ``Auth``)\nto its constructor. ``Client`` then use the crendentials details to make SOAP API calls to available services (``UserListService`` and ``UserListClientService``)\n\nA client customer id is also required to set the SOAP header in every request. You can provide it via an environment variable ``DDP_CLIENT_CUSTOMER_ID`` or pass it\nexplicitly to the constructor.\n\n\n::\n\n credentials = Auth().get_credentials()\n client_customer_id = '123-123-1234'\n api_service = Client(credentials, client_customer_id).user_list_service_soap_client\n\n\n``UserListSelector`` and ``UserListClientSelector``\n^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^\n\nThese two selector classes are provided to specified entities to retrieve. They share the same interface. Example\n\n\n::\n\n from ddpclient import UserListClientSelector, Client, Auth\n import datetime\n\n selector = UserListClientSelector(). \\\n select_fields('ClientCustomerName', 'UserListId'). \\\n filter_by('Status', 'ACTIVE'). \\\n order_by('UserListId'). \\\n order_by('ClientCustomerName', desc=True). \\\n from_date_range(datetime.date(2016, 1, 1), datetime.date(2016, 1, 7)). \\\n at_page(1, 3)\n\n.. _Developer Console: http://\n.. _Customer ID: https://support.google.com/adwords/answer/29198?hl=en-AU\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/insiight/ddpclient", "keywords": "DDP API client", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "ddpclient", "package_url": "https://pypi.org/project/ddpclient/", "platform": "", "project_url": "https://pypi.org/project/ddpclient/", "project_urls": { "Homepage": "https://github.com/insiight/ddpclient" }, "release_url": "https://pypi.org/project/ddpclient/2.0.3/", "requires_dist": null, "requires_python": "", "summary": "A client library for DDP API", "version": "2.0.3" }, "last_serial": 4696696, "releases": { "0.1.0": [], "0.1.1": [ { "comment_text": "", "digests": { "md5": "f96d03a1edbef77ecaa367ec8a399690", "sha256": "1f7ea27190ec3a306e9cfe802e81e0389be944586b86de81bf64c1a1f928b742" }, "downloads": -1, "filename": "ddpclient-0.1.1.tar.gz", "has_sig": false, "md5_digest": "f96d03a1edbef77ecaa367ec8a399690", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6787, "upload_time": "2016-06-10T04:53:55", "url": "https://files.pythonhosted.org/packages/21/bc/ead9331143f9356f84a3d8ed86d7196a1d3b5e3fb7cb449cddd8e8fdfd95/ddpclient-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "d9724f8690a34d97c8ce9c47d85dae2f", "sha256": "028e5ccd5e800eb1ff93831658c9576a9dd868dcd17764dfc10408d8a05b3e47" }, "downloads": -1, "filename": "ddpclient-0.1.2.tar.gz", "has_sig": false, "md5_digest": "d9724f8690a34d97c8ce9c47d85dae2f", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7624, "upload_time": "2016-06-10T14:01:24", "url": "https://files.pythonhosted.org/packages/c3/d1/c85f307c28cb70264f0df85f02ae8f32af3c04d6618353e61b60383f9425/ddpclient-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "27bb165bb896ce355e86a9f2ab1861ab", "sha256": "6b4ac4cd880b95f6ac318c61c725a9b3511ca5c85b9adbe0ff68808b10ee0596" }, "downloads": -1, "filename": "ddpclient-0.1.3.tar.gz", "has_sig": false, "md5_digest": "27bb165bb896ce355e86a9f2ab1861ab", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7927, "upload_time": "2016-06-14T06:23:13", "url": "https://files.pythonhosted.org/packages/b2/88/5074c450d15a51a11caad45f3899557c99825fd1a9f00a7b85329b4dfcea/ddpclient-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "a6ceaac4654c780b4d4923fca8678a67", "sha256": "6c99392f4e794281203f45735dc0f3a82b85fe78f8eae8dfb430825e590b81a6" }, "downloads": -1, "filename": "ddpclient-0.1.4.tar.gz", "has_sig": false, "md5_digest": "a6ceaac4654c780b4d4923fca8678a67", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7934, "upload_time": "2016-06-14T06:49:43", "url": "https://files.pythonhosted.org/packages/de/cc/6d92d32bf215b743cd0925d04977f3ae4c6bf2898cf05bb8b4fb02c7146f/ddpclient-0.1.4.tar.gz" } ], "1.0.0": [ { "comment_text": "", "digests": { "md5": "bbfe0770446ce5115a9c099c2048f620", "sha256": "a0dde7dc423531aa3516b688aa6550bf2079af4b7d5592a55524bc76a2a75ddf" }, "downloads": -1, "filename": "ddpclient-1.0.0.tar.gz", "has_sig": false, "md5_digest": "bbfe0770446ce5115a9c099c2048f620", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8308, "upload_time": "2016-06-15T05:14:29", "url": "https://files.pythonhosted.org/packages/04/bc/64825e4fdfaf95e82d1c80c2da19bb50accd3545d68096fb28d494d22854/ddpclient-1.0.0.tar.gz" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "c10859e7eb71317afcf0669099529378", "sha256": "0a0a18f9073ef0060a74e27364aba705f78e327287bdc9f2cfeaff422b0d68d7" }, "downloads": -1, "filename": "ddpclient-1.0.1.tar.gz", "has_sig": false, "md5_digest": "c10859e7eb71317afcf0669099529378", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8343, "upload_time": "2016-11-08T01:01:14", "url": "https://files.pythonhosted.org/packages/53/be/f75fd586fd7c9555579c7cb89e4208daff3399427d0d221a61bc2280e3b0/ddpclient-1.0.1.tar.gz" } ], "2.0.0": [ { "comment_text": "", "digests": { "md5": "6fd746fed08aa7823e59093c2b4cccfa", "sha256": "727b9991cb5474b983a0a20513aa79f14e72d999c8f1a00fd4f60afe048d4893" }, "downloads": -1, "filename": "ddpclient-2.0.0.tar.gz", "has_sig": false, "md5_digest": "6fd746fed08aa7823e59093c2b4cccfa", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8357, "upload_time": "2017-10-18T00:10:34", "url": "https://files.pythonhosted.org/packages/b8/c9/d4788bff1cca2ddb009a486f87753fa74aafbd8906aae14d6e712397272f/ddpclient-2.0.0.tar.gz" } ], "2.0.1": [ { "comment_text": "", "digests": { "md5": "a50e24cd4c829b91dc7307f8044a1928", "sha256": "5479393aa3f81223a169b11e3d9933f387837482da0534f22a34b220a47b61d4" }, "downloads": -1, "filename": "ddpclient-2.0.1.tar.gz", "has_sig": false, "md5_digest": "a50e24cd4c829b91dc7307f8044a1928", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 11011, "upload_time": "2018-05-07T00:58:44", "url": "https://files.pythonhosted.org/packages/90/71/45a15b3a2e8d2c541c1aa20033450ef090b467f14b857592a06e1e81ba82/ddpclient-2.0.1.tar.gz" } ], "2.0.2": [ { "comment_text": "", "digests": { "md5": "cd8de393e9648ae5060a4ae4fb3d4a7d", "sha256": "da7114fe71d187be21a2fa564e5b0e05fe86ba40ab0759aa54c18df813648fc5" }, "downloads": -1, "filename": "ddpclient-2.0.2.tar.gz", "has_sig": false, "md5_digest": "cd8de393e9648ae5060a4ae4fb3d4a7d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9430, "upload_time": "2019-01-15T00:19:23", "url": "https://files.pythonhosted.org/packages/34/75/1e00b19f634af6d81726377b0fad9f5f6ea6e625596cef9860e29182dca1/ddpclient-2.0.2.tar.gz" } ], "2.0.3": [ { "comment_text": "", "digests": { "md5": "b40ce464db7e427a106670d46d2b1407", "sha256": "816821b3d7760699ce0b38cc49ee4bb64d2f04ac824cb5a1428a2b61499d9933" }, "downloads": -1, "filename": "ddpclient-2.0.3.tar.gz", "has_sig": false, "md5_digest": "b40ce464db7e427a106670d46d2b1407", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9425, "upload_time": "2019-01-15T00:25:20", "url": "https://files.pythonhosted.org/packages/ee/db/9c04a864f2b28f5e34bde5233bae36cc2df15b9091f0e9043a9f2d89673f/ddpclient-2.0.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "b40ce464db7e427a106670d46d2b1407", "sha256": "816821b3d7760699ce0b38cc49ee4bb64d2f04ac824cb5a1428a2b61499d9933" }, "downloads": -1, "filename": "ddpclient-2.0.3.tar.gz", "has_sig": false, "md5_digest": "b40ce464db7e427a106670d46d2b1407", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9425, "upload_time": "2019-01-15T00:25:20", "url": "https://files.pythonhosted.org/packages/ee/db/9c04a864f2b28f5e34bde5233bae36cc2df15b9091f0e9043a9f2d89673f/ddpclient-2.0.3.tar.gz" } ] }