{ "info": { "author": "sharibarboza", "author_email": "barbozashari@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "py_zap\n======\n\npy_zap is a Python scraper for fetching daily broadcast and cable ratings from tvbythenumbers.zap2it.com.\n\nInstallation\n------------\n\nTo install with pip:\n\n>>> pip install py_zap\n\nOr clone this repository and run:\n\n>>> python setup.py install\n\n**Broadcast Ratings**\n\nLet's fetch the `final broadcast ratings for October 27, 2016.`_\n\n.. _final broadcast ratings for October 27, 2016.: http://tvbythenumbers.zap2it.com/daily-ratings/thursday-final-ratings-oct-27-2016/\n\n* **If no date parameter is included, it will default to yesterday's date**\n\n>>> from py_zap import Broadcast\n>>> ratings = Broadcast('October 27, 2016')\n\n* Now we can look at the chart entries:\n\n>>> entry = ratings[0] # Gives the 1st entry\n>>> entry.show # Get the name of the show\n'The Big Bang Theory'\n>>> entry.viewers # Get the number of viewers (in millions)\n14.3\n>>> entry.rating # Get the rating (percentage)\n3.4\n\n* We can also ``print`` out the whole chart by:\n\n>>> print(ratings)\n\n\n>>>\nFinal Broadcast Ratings for Thursday, October 27 2016\n|Show |Time |Network|Viewers|Rating |Share |\n+-------------------------------------------------------------------------+\n|The Big Bang Theory | 8 p.m.| CBS| 14.3| 3.4| 13.0|\n|Grey\u2019s Anatomy | 8 p.m.| ABC| 8.2| 2.2| 8.0|\n|Superstore | 8 p.m.| NBC| 4.2| 1.3| 5.0|\n|Rosewood | 8 p.m.| FOX| 3.4| 0.8| 3.0|\n|Legends of Tomorrow | 8 p.m.| The CW| 1.8| 0.6| 2.0|\n|The Great Indoors | 8:30 p.m.| CBS| 8.8| 1.9| 7.0|\n|The Good Place | 8:30 p.m.| NBC| 3.9| 1.2| 4.0|\n|Mom | 9 p.m.| CBS| 7.0| 1.5| 5.0|\n|Chicago Med | 9 p.m.| NBC| 7.1| 1.5| 5.0|\n|Notorious | 9 p.m.| ABC| 3.8| 0.8| 3.0|\n|Pitch | 9 p.m.| FOX| 2.9| 0.8| 3.0|\n|Supernatural | 9 p.m.| The CW| 1.7| 0.6| 2.0|\n|Life in Pieces | 9:30 p.m.| CBS| 6.0| 1.4| 5.0|\n|Pure Genius | 10 p.m.| CBS| 6.2| 1.0| 4.0|\n|The Blacklist | 10 p.m.| NBC| 5.5| 1.2| 4.0|\n|How to Get Away with Murder | 10 p.m.| ABC| 4.1| 1.2| 4.0|\n\nBy default, the final broadcast ratings are fetched. To access the fast ratings, which are posted earlier but less accurate, set 'final' param to False. If there are no final ratings available, it will redirect to fast access ratings.\n\n>>> ratings = Broadcast('October 27, 2016', final=False)\n\n**Cable Ratings**\n\nTo fetch the `cable ratings for October 27, 2016:`_\n\n.. _cable ratings for October 27, 2016\\:: http://tvbythenumbers.zap2it.com/daily-ratings/thursday-cable-ratings-october-27-2016/\n\n>>> from py_zap import Cable\n>>> ratings = Cable('October 27, 2016')\n\nOther things you can do\n-----------------------\n\n**Sort chart results**\n\n* Broadcast or cable ratings can be sorted based on *show*, *net*, *time*, *rating*, or *viewers*\n* Broadcast ratings only can be sorted on *share*\n\n>>> ratings = Cable('October 27, 2016').sort('viewers') # Sort cable ratings by viewers\n\n>>> ratings = Broadcast('October 27, 2016').sort('share') # Sort broadcast ratings by share (broadcast only)\n\n**Fetch specific shows or networks**\n\n* Pass a list if you want to fetch more than one\n\n>>> ratings = Broadcast('October 27, 2016', show='Supernatural') # Fetch a specific show\n\n>>> ratings = Broadcast('October 27, 2016', network=['CBS', 'NBC']) # Fetch a specific network\n\n**Iterate through multiple weeks**\n\n>>> next_week = ratings.get_next_week() # Get next week's date\n\n>>> last_week = ratings.get_last_week() # Get last week's date\n\n**Get network averages (broadcast only)**\n\n>>> averages = ratings.get_averages() # Get the ratings/viewers averages for broadcast networks\n>>> averages['NBC']\n{'rating': 1.3, 'viewers': 5.56, 'share': 5.0}\n\nDependencies\n------------\n\n* `Beautiful Soup 4`_\n\n.. _Beautiful Soup 4: https://www.crummy.com/software/BeautifulSoup/\n\n* `requests`_\n\n.. _requests: http://requests.readthedocs.io/en/latest/\n\nLicense\n-------\n\n* This project is under the MIT License.\n* All content is owned by Tribune Media Company. See zap2it.com's `Terms of Service`_ for more details.\n\n.. _Terms of Service: http://screenertv.com/terms-of-service/\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "https://github.com/sharibarboza/py_zap/archive/1.0.0.tar.gz", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/sharibarboza/py_zap", "keywords": "zap2it,ratings,tv", "license": "MIT License", "maintainer": "", "maintainer_email": "", "name": "py-zap", "package_url": "https://pypi.org/project/py-zap/", "platform": "", "project_url": "https://pypi.org/project/py-zap/", "project_urls": { "Download": "https://github.com/sharibarboza/py_zap/archive/1.0.0.tar.gz", "Homepage": "https://github.com/sharibarboza/py_zap" }, "release_url": "https://pypi.org/project/py-zap/1.2.2/", "requires_dist": [ "beautifulsoup4", "requests (>=2.9.1)" ], "requires_python": "", "summary": "Python scraper for accessing ratings from tvbythenumbers.zap2it.com", "version": "1.2.2" }, "last_serial": 5148101, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "c8f473517f9f31ff51e8019ad283d1f6", "sha256": "5b6c06a309831773d025c2bedcf21f05259c552c749fc0b7668721917eaeb2b6" }, "downloads": -1, "filename": "py_zap-1.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c8f473517f9f31ff51e8019ad283d1f6", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 12832, "upload_time": "2017-07-27T19:37:24", "url": "https://files.pythonhosted.org/packages/63/f0/510fb642274d21ddbc99a94a1942306c4f522886a15c77b761620f9b7183/py_zap-1.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "25085ca7924ec93a8571152b45d4bb77", "sha256": "94dcd1ddb92668dcb9608b67d428bb4cdc53bdccf67ab4e854dee7fe8b3c0939" }, "downloads": -1, "filename": "py_zap-1.0.0-py3.4.egg", "has_sig": false, "md5_digest": "25085ca7924ec93a8571152b45d4bb77", "packagetype": "bdist_egg", "python_version": "3.4", "requires_python": null, "size": 26588, "upload_time": "2017-07-27T19:37:26", "url": "https://files.pythonhosted.org/packages/aa/75/281ee222ece1bf4f0c60f82dacaf05e0ab88836423d2950839fa0f90ca55/py_zap-1.0.0-py3.4.egg" }, { "comment_text": "", "digests": { "md5": "eff9b1072141fd90a959b9c214143573", "sha256": "53c180ef1bb7613966917e2d41bef4080cf4b40fb78e61d60996e084b22be970" }, "downloads": -1, "filename": "py_zap-1.0.0.tar.gz", "has_sig": false, "md5_digest": "eff9b1072141fd90a959b9c214143573", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 9431, "upload_time": "2017-07-27T19:37:28", "url": "https://files.pythonhosted.org/packages/2a/12/12ee3f4519f9445fdb19577daa8a10b10fa677e0f5d78e4bef09dded4dc0/py_zap-1.0.0.tar.gz" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "5ad9684335c117ba09ff2f12d7191feb", "sha256": "2b757fb9030e7ed4db70d34e2880ab6109b518268b726d0c7fc67b0d997f6295" }, "downloads": -1, "filename": "py_zap-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5ad9684335c117ba09ff2f12d7191feb", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16137, "upload_time": "2018-05-21T07:14:47", "url": "https://files.pythonhosted.org/packages/19/86/209211b7acd23f70b2f5809900a498d492f4ce781a871beccc86e6b2813d/py_zap-1.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "11abded0bd3705f4b7a2e3e9515cc835", "sha256": "f78ccd855acd6bcc48dae5e277a28bbf1e92dc2b87f3c1755fc8ea4df0c64c7f" }, "downloads": -1, "filename": "py_zap-1.1.0.tar.gz", "has_sig": false, "md5_digest": "11abded0bd3705f4b7a2e3e9515cc835", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12814, "upload_time": "2018-05-21T07:14:19", "url": "https://files.pythonhosted.org/packages/8b/99/69294b2eb0dab09d7801946890350b29e2be9fd76670c5fecf925f5863fd/py_zap-1.1.0.tar.gz" } ], "1.2.0": [ { "comment_text": "", "digests": { "md5": "64d53569572b4696be411b97c1791faa", "sha256": "381fd6ca63aa957184c896d4dfe36c2e344cef8df0e9f7fb14989ac7af0f096d" }, "downloads": -1, "filename": "py_zap-1.2.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "64d53569572b4696be411b97c1791faa", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16173, "upload_time": "2018-05-21T08:07:19", "url": "https://files.pythonhosted.org/packages/f6/4e/ee05fec49565057b7c60a5b607344cbd0d53f0ce6ddb0ebc6ad742b4bce4/py_zap-1.2.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "cea6a2959f4643edd990d71caa371e8b", "sha256": "487aeda32bca911c2feaae11f66cac587aa221b46a8e04669f046d0ac39c4c8f" }, "downloads": -1, "filename": "py_zap-1.2.0.tar.gz", "has_sig": false, "md5_digest": "cea6a2959f4643edd990d71caa371e8b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12853, "upload_time": "2018-05-21T08:07:05", "url": "https://files.pythonhosted.org/packages/34/24/d28429976a38753d8a1e5022441fd30041e1e80129501891277cb2386dde/py_zap-1.2.0.tar.gz" } ], "1.2.1": [ { "comment_text": "", "digests": { "md5": "a3a48129bae66f3463c1544db2726bc1", "sha256": "63513c17c8f8ff0159eae534cf1a1ce7e594516adefa5ccde64821bdd2aa19f6" }, "downloads": -1, "filename": "py_zap-1.2.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a3a48129bae66f3463c1544db2726bc1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 16173, "upload_time": "2018-05-21T18:18:43", "url": "https://files.pythonhosted.org/packages/39/38/f0739662aad261dd9f003aad9f6a39c0c7d1ddcd8821e2433b8cbe091677/py_zap-1.2.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "c3d1241b3c97f731fcff69fa6a7277ff", "sha256": "19d169fbfa89d48622f95e3118dc6d1359f379da0a901a31214c2b945d9767b3" }, "downloads": -1, "filename": "py_zap-1.2.1-py3.7.egg", "has_sig": false, "md5_digest": "c3d1241b3c97f731fcff69fa6a7277ff", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 27912, "upload_time": "2019-04-16T04:43:40", "url": "https://files.pythonhosted.org/packages/9a/fe/f83d77ee5429c266c372cf1b63575850eb73412e68f4581928c3a42a41d8/py_zap-1.2.1-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "ff473654b304168bd91c398bae49e18e", "sha256": "a371041d481434597d6489ef47192e8df2bf25496d6e98d76a498f6588eb8a5f" }, "downloads": -1, "filename": "py_zap-1.2.1.tar.gz", "has_sig": false, "md5_digest": "ff473654b304168bd91c398bae49e18e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12863, "upload_time": "2018-05-21T18:18:21", "url": "https://files.pythonhosted.org/packages/1a/4c/5054afc106c7a5a573034e1333f23260cc5935a391fd62f2e94c5e203918/py_zap-1.2.1.tar.gz" } ], "1.2.2": [ { "comment_text": "", "digests": { "md5": "87e9d1a5e8f8da09a614b30602b68408", "sha256": "a1e75c079732f1978ddf0c8f531b35cf90c83069017a2f822a005b13b61729c4" }, "downloads": -1, "filename": "py_zap-1.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "87e9d1a5e8f8da09a614b30602b68408", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13627, "upload_time": "2019-04-16T04:43:39", "url": "https://files.pythonhosted.org/packages/34/c4/00c4954b83e717408cb27c778937c0072d17830f695e133417f090862dd4/py_zap-1.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9dec54809c2bece422160711c82a48f5", "sha256": "1988f9b27807dc5f0b3718d938db4d0e5cfbed45221caecbe0aa3c415d8008cb" }, "downloads": -1, "filename": "py_zap-1.2.2-py3.7.egg", "has_sig": false, "md5_digest": "9dec54809c2bece422160711c82a48f5", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 27911, "upload_time": "2019-04-16T04:43:43", "url": "https://files.pythonhosted.org/packages/02/4a/83d7223d9f3b57a19856d057b51dff80e5e8b1941831f425bccec6939c16/py_zap-1.2.2-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "f5e71f0f81b5ecae2337dbcfa523d677", "sha256": "7f2bbee78bdff4d9c6a1262e187990e4d16aab646ded28554133d4ad09b1111f" }, "downloads": -1, "filename": "py_zap-1.2.2.tar.gz", "has_sig": false, "md5_digest": "f5e71f0f81b5ecae2337dbcfa523d677", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12822, "upload_time": "2019-04-16T04:43:44", "url": "https://files.pythonhosted.org/packages/36/e7/583b8a01b5834684779203558bd5f167152fa69aff6fab636b24066f9554/py_zap-1.2.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "87e9d1a5e8f8da09a614b30602b68408", "sha256": "a1e75c079732f1978ddf0c8f531b35cf90c83069017a2f822a005b13b61729c4" }, "downloads": -1, "filename": "py_zap-1.2.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "87e9d1a5e8f8da09a614b30602b68408", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13627, "upload_time": "2019-04-16T04:43:39", "url": "https://files.pythonhosted.org/packages/34/c4/00c4954b83e717408cb27c778937c0072d17830f695e133417f090862dd4/py_zap-1.2.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "9dec54809c2bece422160711c82a48f5", "sha256": "1988f9b27807dc5f0b3718d938db4d0e5cfbed45221caecbe0aa3c415d8008cb" }, "downloads": -1, "filename": "py_zap-1.2.2-py3.7.egg", "has_sig": false, "md5_digest": "9dec54809c2bece422160711c82a48f5", "packagetype": "bdist_egg", "python_version": "3.7", "requires_python": null, "size": 27911, "upload_time": "2019-04-16T04:43:43", "url": "https://files.pythonhosted.org/packages/02/4a/83d7223d9f3b57a19856d057b51dff80e5e8b1941831f425bccec6939c16/py_zap-1.2.2-py3.7.egg" }, { "comment_text": "", "digests": { "md5": "f5e71f0f81b5ecae2337dbcfa523d677", "sha256": "7f2bbee78bdff4d9c6a1262e187990e4d16aab646ded28554133d4ad09b1111f" }, "downloads": -1, "filename": "py_zap-1.2.2.tar.gz", "has_sig": false, "md5_digest": "f5e71f0f81b5ecae2337dbcfa523d677", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12822, "upload_time": "2019-04-16T04:43:44", "url": "https://files.pythonhosted.org/packages/36/e7/583b8a01b5834684779203558bd5f167152fa69aff6fab636b24066f9554/py_zap-1.2.2.tar.gz" } ] }