{ "info": { "author": "Antoine Francais", "author_email": "antoine.francais@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "# pytaboola\nPython client for Taboola API (https://github.com/taboola/Backstage-API).\nBefore any use of this client, you must have gotten your API client ID and client secret from your Taboola account manager.\n\nClient ID is required for any usage.\n\n\n## Authentication and authorization\n\nThis client supports both access_token/refresh_token and\nclient_id/client_secret OAuth2 authorization methods.\n\nThe access_token/refresh_token method is the recommended one, but\nfollowing examples will use the other one as it is easier to implement.\n\n\n### Simple Connection\nExample of a simple connection using client_id/client_secret.\n```python\nCLIENT_ID = 'XXXXX'\nCLIENT_SECRET = 'YYYYY'\n\nfrom pytaboola import TaboolaClient\nclient = TaboolaClient(CLIENT_ID, client_secret=CLIENT_SECRET)\nclient.token_details\n> {'account_id': 'my-taboola-account',\n 'expires_in': 43189,\n 'full_name': 'User Name',\n 'username': 'user@mail.me'}\n```\n\n## Services\nHere is a quick description of the services provided by this client.\n\n### Account listing\nA service with only one method, allowing to list advertiser accounts linked to your main Taboola account.\nThis service is read-only. \n\n```python\nCLIENT_ID = 'XXXXX'\nCLIENT_SECRET = 'YYYYY'\n\nfrom pytaboola import TaboolaClient\nfrom pytaboola.services import AccountService\nclient = TaboolaClient(CLIENT_ID, client_secret=CLIENT_SECRET)\nservice = AccountService(client)\nservice.list()\n>>> {'results': [{'account_id': 'my-first-acount',\n 'campaign_types': ['PAID'],\n 'id': 1111111,\n 'name': 'My First Taboola Account',\n 'partner_types': ['ADVERTISER'],\n 'type': 'PARTNER'},\n {'account_id': 'my-other-account',\n 'campaign_types': ['PAID'],\n 'id': 2222222,\n 'name': 'My Other Taboola Account',\n 'partner_types': ['ADVERTISER'],\n 'type': 'PARTNER'}]}\n```\n\n### Campaign CRUD\n\nSimple CRUD service implementing listing, access, creation, edition.\nAll requests are scoped by account. So, it is impossible to list campaigns cross accounts.\n\n\nService is instanciated as follow.\n```python\nCLIENT_ID = 'XXXXX'\nCLIENT_SECRET = 'YYYYY'\n\nfrom pytaboola import TaboolaClient\nfrom pytaboola.services import CampaignService\nclient = TaboolaClient(CLIENT_ID, client_secret=CLIENT_SECRET)\nservice = CampaignService(client, 'my-account-id')\n```\n\n#### Methods\n##### List all campaigns for an account :\n```\nservice.list()\n```\n\n##### Get a campaign :\n```\nservice.get('my-campaign-id')\n```\n\n##### Update a campaign :\n```\nservice.get('my-campaign-id', **attrs)\n```\nPlease note that update is partial. To delete a field, you will have to set it at None explicitly (if this attribute is nullable obviously).\n\n##### Create a campaign :\n```\nservice.create(**attrs)\n```\n\nIn these last examples, ```attrs``` is a dict containing attributes of the campaign.\nFor more information on campaign attributes, please see the Backstage API documentation at\nhttps://github.com/taboola/Backstage-API/blob/master/Backstage%20API%20-%20Campaigns.pdf\n\n\n### Campaign Item CRUD\nAs with Campaign CRUD service, this is a simple CRUD service implementing listing, access, creation, edition. \nAll requests are scoped by campaign.\n\n```python\nCLIENT_ID = 'XXXXX'\nCLIENT_SECRET = 'YYYYY'\n\nfrom pytaboola import TaboolaClient\nclient = TaboolaClient(CLIENT_ID, client_secret=CLIENT_SECRET)\nservice = CampaignItemService(client, 'my-account-id', 'my-campaign-id')\nservice.list()\n```\n\n#### Methods\nBasic CRUD methods have the same signature as the ones of the campaign service.\n\n##### List all RSS Children for this campaign :\n```\nservice.children()\n```\n\n##### Get a child item by its ID :\n```\nservice.child('my-child-id')\n```\n\n##### Update a child :\n```\nservice.child('my-child-id', **attrs)\n```\nFor more information on campaign item attributes and what RSS Children are, please see the Backstage API documentation at\nhttps://github.com/taboola/Backstage-API/blob/master/Backstage%20API%20-%20Campaign%20Items.pdf\n\n### Reports\n\nAll report services have only a fetch method, with the following signature :\n\n```python\ndef fetch(self, dimension, start_date, end_date, **filters)\n```\nwhere dimension is the aggregation view of the report, start_date and end_date delimitate the period to fetch the report on,\n and filters are ways to narrow down your report data.\n\nFor more information, please refer to the Backstage API documentation :\nhttps://github.com/taboola/Backstage-API/blob/master/Backstage%20API%20-%20Reports.pdf\n\nAvailable services are :\n * CampaignSummaryReport\n * TopCampaignContentReport\n * RevenueSummaryReport\n * VisitValueReport\n * RecirculationSummaryReport\n\n\n## Todo:\n### Resource services\nResource services are available in this client, but not all endpoints are available.\nAlso, they are not properly documented.\n\n### Testing\nThere is not much intelligence in this wrapper,\nbut all utility functions (such as response parsing) and authentication /\nrefresh workflow should be tested to avoid regressions.\n\n### Data validators\nAs for now, all data validation is delegated to the Taboola API. It may be useful to had a small bit of data type checking before any call.\n\n### Authentication\nuser/password authentication method is not implemented. It should be useless in any production environment,\nbut may be used as a fast POC/testing authentication system.\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/dolead/pytaboola", "keywords": "taboola api", "license": "MIT", "maintainer": "Dolead", "maintainer_email": "it@dolead.com", "name": "pytaboola", "package_url": "https://pypi.org/project/pytaboola/", "platform": "", "project_url": "https://pypi.org/project/pytaboola/", "project_urls": { "Homepage": "https://github.com/dolead/pytaboola" }, "release_url": "https://pypi.org/project/pytaboola/0.1.2/", "requires_dist": [ "requests", "python-dateutil" ], "requires_python": "", "summary": "Python client for Taboola API", "version": "0.1.2" }, "last_serial": 4092887, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "6f4d0c839148084481bef9ef8c46d351", "sha256": "a2b8714c2a23a7ce7452bf364fb7300fb0e85126ead72231511e377c479d7be5" }, "downloads": -1, "filename": "pytaboola-0.1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "6f4d0c839148084481bef9ef8c46d351", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9022, "upload_time": "2018-06-04T10:34:00", "url": "https://files.pythonhosted.org/packages/b7/5c/a286bdd6ce62ded42c0e0e85f1abdf0e28a126b36ec07619cd0b4fae1657/pytaboola-0.1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "93df707e4849e145dfd6c8bc2393c4c2", "sha256": "e7614b79c6cdd77870874b8ef91a87fb43b1c2502aef676f8a7e0dc4f8c4e57e" }, "downloads": -1, "filename": "pytaboola-0.1.0.tar.gz", "has_sig": false, "md5_digest": "93df707e4849e145dfd6c8bc2393c4c2", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6862, "upload_time": "2018-06-04T10:34:01", "url": "https://files.pythonhosted.org/packages/00/ae/113b6daa5bdcac030e685c60427e24fec58e2f72a2720739b2150fc13329/pytaboola-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a14b8c5ef8943904e7cf0421e29a21b7", "sha256": "7def813f1ca3900f395df09f869bf52a5a70d342faba148fe7f5c909188e1ec3" }, "downloads": -1, "filename": "pytaboola-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "a14b8c5ef8943904e7cf0421e29a21b7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9050, "upload_time": "2018-06-04T12:05:25", "url": "https://files.pythonhosted.org/packages/ef/99/8e4dd4250ce53573a4f3890a9890da6ed58cae7ea539bf74787ed1b679f8/pytaboola-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56bc77a17c403ce62b1da30101f05bc1", "sha256": "fba15582d6f17f9d7ffdfd5fd6aacf8afbf073c5ced568fdb5427b4fa64e1b9d" }, "downloads": -1, "filename": "pytaboola-0.1.1.tar.gz", "has_sig": false, "md5_digest": "56bc77a17c403ce62b1da30101f05bc1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8523, "upload_time": "2018-06-04T12:05:27", "url": "https://files.pythonhosted.org/packages/92/e9/061e3eb9c330ad3a2195a248a65950710130ea3cb495ac37b9755eed1ccb/pytaboola-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "66b118b2626fa974af9ce34f2245eeb7", "sha256": "de10e38ee1403b405850c4f5ee8f0bd0d503df302e1e4039b66492e8bd1dea48" }, "downloads": -1, "filename": "pytaboola-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "66b118b2626fa974af9ce34f2245eeb7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9069, "upload_time": "2018-07-23T12:21:00", "url": "https://files.pythonhosted.org/packages/a3/74/92652c57288f41ae6aa6d89d2128eca5f432e8874cf095bba7e2949cf7f3/pytaboola-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b516c3e5e20c7be295e473fc11a1f38e", "sha256": "ec2059ac4a6a64af3e2365a3e479ca2c6f1c3c7a16238c2f7437edab5d54bcf3" }, "downloads": -1, "filename": "pytaboola-0.1.2.tar.gz", "has_sig": false, "md5_digest": "b516c3e5e20c7be295e473fc11a1f38e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8552, "upload_time": "2018-07-23T12:21:01", "url": "https://files.pythonhosted.org/packages/6f/7b/d5f5f7d68996959cc0f81dc6b89970199002f98d60c73976c30fdc07e25a/pytaboola-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "66b118b2626fa974af9ce34f2245eeb7", "sha256": "de10e38ee1403b405850c4f5ee8f0bd0d503df302e1e4039b66492e8bd1dea48" }, "downloads": -1, "filename": "pytaboola-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "66b118b2626fa974af9ce34f2245eeb7", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 9069, "upload_time": "2018-07-23T12:21:00", "url": "https://files.pythonhosted.org/packages/a3/74/92652c57288f41ae6aa6d89d2128eca5f432e8874cf095bba7e2949cf7f3/pytaboola-0.1.2-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b516c3e5e20c7be295e473fc11a1f38e", "sha256": "ec2059ac4a6a64af3e2365a3e479ca2c6f1c3c7a16238c2f7437edab5d54bcf3" }, "downloads": -1, "filename": "pytaboola-0.1.2.tar.gz", "has_sig": false, "md5_digest": "b516c3e5e20c7be295e473fc11a1f38e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8552, "upload_time": "2018-07-23T12:21:01", "url": "https://files.pythonhosted.org/packages/6f/7b/d5f5f7d68996959cc0f81dc6b89970199002f98d60c73976c30fdc07e25a/pytaboola-0.1.2.tar.gz" } ] }