{ "info": { "author": "Itiel Shwartz", "author_email": "itiel@etlsh.com", "bugtrack_url": null, "classifiers": [ "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Natural Language :: English", "Programming Language :: Python :: 3.6" ], "description": "asyncio-hn\n==========\n\nA simple asyncio wrapper to download\n`hacker-news `__ with speed and ease.\n\nThe package supports all endpoints of the official API : `hacker-news\nAPI `__\n\nInstallation\n------------\n\n.. code:: shell\n\n pip install asyncio-hn\n\nUsage\n-----\n\n.. code:: python\n\n import asyncio\n from asyncio_hn import ClientHN\n\n async def main(loop):\n # We init the client - extension of aiohttp.ClientSession\n async with ClientHN(loop=loop) as hn:\n # Up to 500 top and top stories (only ids)\n hn_new_stories = await hn.top_stories()\n # Download top 10 story data\n top_posts = await hn.items(hn_new_stories[:10])\n # Download the user data for each story\n users = await hn.users([post.get(\"by\") for post in top_posts])\n\n\n if __name__ == '__main__':\n loop = asyncio.get_event_loop()\n loop.run_until_complete(main(loop))\n\nAdvance usage\n~~~~~~~~~~~~~\n\nUsing this config you can reach 1000+ request/sec.\n\n.. code:: python\n import aiohttp\n from asyncio_hn import ClientHN\n \n N = 1_000_000\n\n async def advance_run(loop):\n # We init the client - extension of aiohttp.ClientSession\n conn = aiohttp.TCPConnector(limit=1000, loop=loop)\n async with ClientHN(loop=loop, queue_size=1000, connector=conn, progress_bar=True, debug=True) as hn:\n # Download the last 1,000,000 stories\n hn_new_stories = await hn.last_n_items(n=N)\n\nOutput example:\n---------------\n\nItem:\n\n.. code:: python\n\n item = {'by': 'amzans', 'descendants': 25, 'id': 13566716,\n 'kids': [13567061, 13567631, 13567027, 13567055, 13566798, 13567473], 'score': 171, 'time': 1486210548,\n 'title': 'Network programming with Go (2012)', 'type': 'story',\n 'url': 'https://jannewmarch.gitbooks.io/network-programming-with-go-golang-/content/'},\n {'by': 'r3bl', 'descendants': 1, 'id': 13567940, 'kids': [13568249], 'score': 24, 'time': 1486230224,\n 'title': 'YouTube removes hundreds of the best climate science videos from the Internet',\n 'type': 'story',\n 'url': 'http://climatestate.com/2017/02/03/youtube-removes-hundreds-of-the-best-climate-science-videos-from-the-internet/'}\n\nUser:\n\n.. code:: python\n\n user = {'created': 1470758993, 'id': 'amzans', 'karma': 174,\n 'submitted': [13567884, 13566716, 13566699, 13558456, 13539270, 13539151, 13514498, 13418469, 13417725,\n 13416562, 13416097, 13416034, 13415954, 13415894, 13395310, 13394996, 13392554, 12418804,\n 12418361, 12413958, 12411992, 12411732, 12411546, 12262383, 12255593]}\n\n\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/itielshwartz/asyncio-hn", "keywords": "asyncio", "license": "MIT license", "maintainer": "", "maintainer_email": "", "name": "asyncio_hn", "package_url": "https://pypi.org/project/asyncio_hn/", "platform": "", "project_url": "https://pypi.org/project/asyncio_hn/", "project_urls": { "Homepage": "https://github.com/itielshwartz/asyncio-hn" }, "release_url": "https://pypi.org/project/asyncio_hn/0.4.0/", "requires_dist": null, "requires_python": "", "summary": " Simple asyncio wrapper to download hackernews", "version": "0.4.0" }, "last_serial": 2736996, "releases": { "0.1.0": [ { "comment_text": "", "digests": { "md5": "92c84e7800740f0a20840184757f95b8", "sha256": "c7a9d317f961834f4269594d29b512b9acbe8f5d55123f7aac648b80cb7fae55" }, "downloads": -1, "filename": "asyncio_hn-0.1.0.tar.gz", "has_sig": false, "md5_digest": "92c84e7800740f0a20840184757f95b8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3766, "upload_time": "2017-02-07T08:01:59", "url": "https://files.pythonhosted.org/packages/97/04/2800b9a2f86a07ec7c91ad935e12c754f59b62ba1d54e7b915df03364bed/asyncio_hn-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "a906b53e8606979bc1411fc151005a98", "sha256": "1d15037393f9167b4706c6bfa382fdd874ce6e477972082418cf443fe591cc61" }, "downloads": -1, "filename": "asyncio_hn-0.1.1.tar.gz", "has_sig": false, "md5_digest": "a906b53e8606979bc1411fc151005a98", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3765, "upload_time": "2017-02-07T08:05:46", "url": "https://files.pythonhosted.org/packages/a0/56/99914a10df631b20f69e5a4690d46134bb1bd7bbe8b73be856da503ab4d9/asyncio_hn-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "963e3c2bd7c93a2ac92a50ac67c7cc28", "sha256": "3409bb078420e966e7d0bddb293785b833ef53720e17d4dcba10fcd13a207ab3" }, "downloads": -1, "filename": "asyncio_hn-0.1.2.tar.gz", "has_sig": false, "md5_digest": "963e3c2bd7c93a2ac92a50ac67c7cc28", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3804, "upload_time": "2017-02-07T14:58:54", "url": "https://files.pythonhosted.org/packages/13/dc/32b50f53b2290b88b79af5523b98ea5e957045ecacf3da2e21f81ef89007/asyncio_hn-0.1.2.tar.gz" } ], "0.1.3": [ { "comment_text": "", "digests": { "md5": "a3ff934512b245b5c614d673208c5752", "sha256": "872e1074ba13a1806e8a1e98879c2f1b22e1d1b5b10745f14d579143c4efd79c" }, "downloads": -1, "filename": "asyncio_hn-0.1.3.tar.gz", "has_sig": false, "md5_digest": "a3ff934512b245b5c614d673208c5752", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 3973, "upload_time": "2017-02-07T15:10:46", "url": "https://files.pythonhosted.org/packages/4a/ba/3e30ff9181347def947a023063a3dc32c6cfcc8c6c13a35226791db714e5/asyncio_hn-0.1.3.tar.gz" } ], "0.1.4": [ { "comment_text": "", "digests": { "md5": "b9a3dc8529804f05e208bb8dc6001e82", "sha256": "09bba63067bc7b62d5f0afb738b0f91ba16bc6b04124e3d91ca3435ff4e25d74" }, "downloads": -1, "filename": "asyncio_hn-0.1.4.tar.gz", "has_sig": false, "md5_digest": "b9a3dc8529804f05e208bb8dc6001e82", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4100, "upload_time": "2017-02-07T15:17:06", "url": "https://files.pythonhosted.org/packages/93/e8/985e7d5a3f6d433fde3f41ac1dd36037bd8942e6edcbc4904e2946361adf/asyncio_hn-0.1.4.tar.gz" } ], "0.1.5": [ { "comment_text": "", "digests": { "md5": "469734b13a231870a5551641ded87521", "sha256": "aad850f4f5df7651f11c57ce3024ea2b5d908b55e655cb03059cbc7505bb1ac2" }, "downloads": -1, "filename": "asyncio_hn-0.1.5.tar.gz", "has_sig": false, "md5_digest": "469734b13a231870a5551641ded87521", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4251, "upload_time": "2017-02-08T05:57:39", "url": "https://files.pythonhosted.org/packages/fb/98/ec8be6baa94a15ca4a6bb50c5a2b733435887f3e6fa781dd3fea54c5439e/asyncio_hn-0.1.5.tar.gz" } ], "0.2.0": [ { "comment_text": "", "digests": { "md5": "a9da2cf725511b0ef6bc623208159514", "sha256": "dfa0757056f291aed7e36af8510b22a1c55c2b74dd6911060e5bad3c9e107560" }, "downloads": -1, "filename": "asyncio_hn-0.2.0.tar.gz", "has_sig": false, "md5_digest": "a9da2cf725511b0ef6bc623208159514", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4253, "upload_time": "2017-02-08T15:29:31", "url": "https://files.pythonhosted.org/packages/36/6a/94e8f1642c0fce005151cc3c47404f237cb15326ff029f72a5e227c659dc/asyncio_hn-0.2.0.tar.gz" } ], "0.3.0": [ { "comment_text": "", "digests": { "md5": "2d50a3125be4f527542658170847ee88", "sha256": "460ce9bbcd9ae3db9ca1c934daf07e2f2a493afdc9692b81ad7f8e4d2d93509e" }, "downloads": -1, "filename": "asyncio_hn-0.3.0.tar.gz", "has_sig": false, "md5_digest": "2d50a3125be4f527542658170847ee88", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4282, "upload_time": "2017-03-28T18:57:26", "url": "https://files.pythonhosted.org/packages/00/08/09e5a834c0aa92b9467940270047a0da1d20a5dc61696a44cf6ea0ca26f7/asyncio_hn-0.3.0.tar.gz" } ], "0.4.0": [ { "comment_text": "", "digests": { "md5": "75da60e4e063558dd18c5a416ded189d", "sha256": "6e34cef66c1dcc20a8abbe0253f6c5a75e871eb96a5d098c29562edf0958a9a0" }, "downloads": -1, "filename": "asyncio_hn-0.4.0.tar.gz", "has_sig": false, "md5_digest": "75da60e4e063558dd18c5a416ded189d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4272, "upload_time": "2017-03-28T20:14:39", "url": "https://files.pythonhosted.org/packages/92/be/8a92363886ce4c23ddccce7fed152ceffa1ab5cd72c71ee99c52af2ca608/asyncio_hn-0.4.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "75da60e4e063558dd18c5a416ded189d", "sha256": "6e34cef66c1dcc20a8abbe0253f6c5a75e871eb96a5d098c29562edf0958a9a0" }, "downloads": -1, "filename": "asyncio_hn-0.4.0.tar.gz", "has_sig": false, "md5_digest": "75da60e4e063558dd18c5a416ded189d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 4272, "upload_time": "2017-03-28T20:14:39", "url": "https://files.pythonhosted.org/packages/92/be/8a92363886ce4c23ddccce7fed152ceffa1ab5cd72c71ee99c52af2ca608/asyncio_hn-0.4.0.tar.gz" } ] }