{ "info": { "author": "LittleCoder", "author_email": "i7meavnktqegm1b@qq.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 3 - Alpha", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3", "Topic :: Software Development :: Libraries :: Python Modules" ], "description": "Trip: Async HTTP for Humans\r\n===========================\r\n\r\n.. image:: https://img.shields.io/pypi/v/trip.svg\r\n :target: https://pypi.python.org/pypi/trip\r\n\r\n.. image:: https://img.shields.io/pypi/l/trip.svg\r\n :target: https://pypi.python.org/pypi/trip\r\n\r\n.. image:: https://img.shields.io/pypi/pyversions/trip.svg\r\n :target: https://pypi.python.org/pypi/trip\r\n\r\n.. image:: https://img.shields.io/badge/Say%20Thanks-!-1EAEDB.svg\r\n :target: https://saythanks.io/to/littlecodersh\r\n\r\n.. image:: https://img.shields.io/badge/\u4e2d\u6587---%3E-yellow.svg\r\n :target: https://github.com/littlecodersh/trip/blob/master/README_CN.md\r\n\r\nTRIP, Tornado & Requests In Pair, an async HTTP library for Python.\r\n\r\nSimple as Requests, Trip let you get rid of annoying network blocking.\r\n\r\nCoroutine in python 2.7+ can be this simple:\r\n\r\n.. code-block:: python\r\n\r\n import trip\r\n\r\n def main():\r\n r = yield trip.get('https://httpbin.org/get', auth=('user', 'pass'))\r\n print(r.content)\r\n\r\n trip.run(main)\r\n\r\nWith Trip, you may finish\r\n`one hundred requests in one piece of time `_.\r\n\r\nTrip gets its name from two powerful site packages and aims to combine them together.\r\nTrip refers to 'Tornado & Requests In Pair', TRIP.\r\nTo put them together, I reused much of their codes about structure and dealing.\r\nActually I only made little effort to make a mixture. Thanks to \r\n`Tornado `_ and \r\n`Requests `_.\r\n\r\nThrough using Trip, you may take full advantage of Requests, including:\r\nSessions with Cookie persistence, browser-style SSL verification, automatic content decoding,\r\nbasic/digest authentication, elegant key/value Cookies.\r\nMeanwhile, your requests are coroutine like using AsyncHTTPClient of Tornado, network blocking will\r\nnot be a problem.\r\n\r\nFound difficult optimizing spiders' time consuming?\r\nFound tricky using asyncio http packages?\r\nFound heavy custimizing big spider framework?\r\nTry Trip, you will not regret!\r\n\r\n\r\nInstallation\r\n------------\r\n\r\nPaste it into your console and enjoy:\r\n\r\n.. code-block:: bash\r\n\r\n $ python -m pip install trip\r\n\r\n\r\nDocuments\r\n---------\r\n\r\nDocuments are here: http://trip.readthedocs.io/\r\n\r\n\r\nAdvanced usage\r\n--------------\r\n\r\nSome of the advaced features are listed here:\r\n\r\nUsing async and await in python 3:\r\n\r\n.. code-block:: python\r\n\r\n import trip\r\n\r\n async def main():\r\n r = await trip.get('https://httpbin.org/get', auth=('user', 'pass'))\r\n print(r.content)\r\n\r\n trip.run(main)\r\n\r\nSessions with Cookie persistence\r\n\r\n.. code-block:: python\r\n\r\n import trip\r\n\r\n def main():\r\n s = trip.Session()\r\n r = yield s.get(\r\n 'https://httpbin.org/cookies/set',\r\n params={'name': 'value'},\r\n allow_redirects=False)\r\n r = yield s.get('https://httpbin.org/cookies')\r\n print(r.content)\r\n\r\n trip.run(main)\r\n\r\nEvent hooks\r\n\r\n.. code-block:: python\r\n\r\n import trip\r\n\r\n def main():\r\n def print_url(r, *args, **kwargs):\r\n print(r.url)\r\n def record_hook(r, *args, **kwargs):\r\n r.hook_called = True\r\n return r\r\n url = 'http://httpbin.org/get'\r\n r = yield trip.get('http://httpbin.org', hooks={'response': [print_url, record_hook]})\r\n print(r.hook_called)\r\n\r\n trip.run(main)\r\n\r\nTimeouts\r\n\r\n.. code-block:: python\r\n\r\n import trip\r\n\r\n def main():\r\n r = yield trip.get('http://github.com', timeout=0.001)\r\n print(r)\r\n\r\n trip.run(main)\r\n\r\nProxy\r\n\r\n.. code-block:: python\r\n\r\n import trip\r\n\r\n proxies = {\r\n 'http': '127.0.0.1:8080',\r\n 'https': '127.0.0.1:8081',\r\n }\r\n\r\n def main():\r\n r = yield trip.get('https://httpbin.org/get', proxies=proxies)\r\n print(r.content)\r\n\r\n trip.run(main)\r\n\r\n\r\nHow to contribute\r\n-----------------\r\n\r\n#. You may open an issue to share your ideas with me.\r\n#. Or fork this `project `_ and do it your own on **master** branch.\r\n#. Please write demo codes of bugs or new features. You know, codes help.\r\n#. Finally if you finish your work and make a pull request, I will merge it in time after essential tests.\r\n\r\n\r\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/littlecodersh/trip", "keywords": "coroutine requests http spider", "license": "Apache 2.0", "maintainer": "", "maintainer_email": "", "name": "trip", "package_url": "https://pypi.org/project/trip/", "platform": "", "project_url": "https://pypi.org/project/trip/", "project_urls": { "Homepage": "https://github.com/littlecodersh/trip" }, "release_url": "https://pypi.org/project/trip/0.0.10/", "requires_dist": [ "requests (>=2.18.4)", "tornado (==4.5.3)" ], "requires_python": "", "summary": "Async HTTP for humans, coroutine Requests.", "version": "0.0.10" }, "last_serial": 3709118, "releases": { "0.0.0": [ { "comment_text": "", "digests": { "md5": "6cf4454dda884cb7294a86e6a565e9c3", "sha256": "b585e3995667d2a03018f29fe7bb6f05ced938856e89b8cbb41eed34af16ce7e" }, "downloads": -1, "filename": "trip-0.0.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6cf4454dda884cb7294a86e6a565e9c3", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2454, "upload_time": "2017-02-16T02:43:50", "url": "https://files.pythonhosted.org/packages/64/2c/fa4faef9833cf84067a52f2b9efa9e5d3ee774fcba99572068381d35b7fe/trip-0.0.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "5db072e926d18593481d112c351b7f8c", "sha256": "cdeced3b17d237d1f09907049eeba2fcf7ba2dd844efcadf25c280d57c1ba246" }, "downloads": -1, "filename": "trip-0.0.0.tar.gz", "has_sig": false, "md5_digest": "5db072e926d18593481d112c351b7f8c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 1438, "upload_time": "2017-02-16T02:43:52", "url": "https://files.pythonhosted.org/packages/e1/8e/2afdb457b08c3b60a14e8e9cca255debd2200d34342cd5586ec2595fe97f/trip-0.0.0.tar.gz" } ], "0.0.1": [ { "comment_text": "", "digests": { "md5": "349c3d385bf3bb2142bf037f4eeb760a", "sha256": "76bc65a869503e0e24221659a8e3492fa6e1c92ced3fd8adb424448d1e5b4d03" }, "downloads": -1, "filename": "trip-0.0.1-py2.7.egg", "has_sig": false, "md5_digest": "349c3d385bf3bb2142bf037f4eeb760a", "packagetype": "bdist_egg", "python_version": "2.7", "requires_python": null, "size": 44931, "upload_time": "2017-10-31T09:03:32", "url": "https://files.pythonhosted.org/packages/de/b6/43c561de7bc8d5e636a01ed9c6bde5c07ad4f9b12144f2008b97722d2d57/trip-0.0.1-py2.7.egg" }, { "comment_text": "", "digests": { "md5": "2d0574cc7d3bec2518e02afed6f84650", "sha256": "50986f5ecc979b767019dbfedbe0ffba542d904f8a153b567af6af06fe8c2790" }, "downloads": -1, "filename": "trip-0.0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2d0574cc7d3bec2518e02afed6f84650", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 23888, "upload_time": "2017-10-31T09:03:30", "url": "https://files.pythonhosted.org/packages/5b/70/5db05ce8110906f583897e6e139a2fd5f3424969b5100ad4fc394b6fdce3/trip-0.0.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "71d005a8cd88aea51d322c32013d3a2c", "sha256": "e6e9dbabd7612ded4f120ba5ba281e79d94939f64e980eba259379a4151f4611" }, "downloads": -1, "filename": "trip-0.0.1.tar.gz", "has_sig": false, "md5_digest": "71d005a8cd88aea51d322c32013d3a2c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20443, "upload_time": "2017-10-31T09:03:34", "url": "https://files.pythonhosted.org/packages/36/36/eecaab27e28f7f01448fe2f0a858ebbafee8cd5175b9c3f37279686a9ac3/trip-0.0.1.tar.gz" } ], "0.0.10": [ { "comment_text": "", "digests": { "md5": "019b846704c37de4908b3471a276fc57", "sha256": "c60a7d291d84ee37a7343ca00276e46aa2af5d430b5d227b40a847dcb43e2ef7" }, "downloads": -1, "filename": "trip-0.0.10-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "019b846704c37de4908b3471a276fc57", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 30229, "upload_time": "2018-03-27T05:18:11", "url": "https://files.pythonhosted.org/packages/d7/e7/604bf7e9a6460fd4f4c2d108762336da6eb4f54edf4e9e99c4754984a6fe/trip-0.0.10-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a231ed421e3fe723113d123e939a6a6", "sha256": "61efa349f5b10b8b9b34a94897873543005b83c83e6ebf86edc906044015d008" }, "downloads": -1, "filename": "trip-0.0.10.tar.gz", "has_sig": false, "md5_digest": "2a231ed421e3fe723113d123e939a6a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26117, "upload_time": "2018-03-27T05:18:12", "url": "https://files.pythonhosted.org/packages/50/25/005d1e7eb79f59c8d900b53d81713d9a1f44a7bad5cc7223adea4b09134f/trip-0.0.10.tar.gz" } ], "0.0.2": [ { "comment_text": "", "digests": { "md5": "19ee18d70ffd29e4abdcd30d7b4d46fd", "sha256": "4b3a683be698f810f92704829a071f87c7abfe1070634657e542fdef5c46d265" }, "downloads": -1, "filename": "trip-0.0.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "19ee18d70ffd29e4abdcd30d7b4d46fd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24336, "upload_time": "2017-11-02T01:30:02", "url": "https://files.pythonhosted.org/packages/6e/3c/c03404a9a550640376c6b1b9a280a1bd470335980e56a230799907333417/trip-0.0.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3cd8ac74954da5c0bf09737e91a7034", "sha256": "dfd5783e56c9cda5643758869f73a20c21ec35183fc4599e87d454bd6c325656" }, "downloads": -1, "filename": "trip-0.0.2.tar.gz", "has_sig": false, "md5_digest": "a3cd8ac74954da5c0bf09737e91a7034", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20827, "upload_time": "2017-11-02T01:30:04", "url": "https://files.pythonhosted.org/packages/fb/4d/237d3e162e6137edfec0843238c7796733ba9b36b774ec5007e1c08e1f4e/trip-0.0.2.tar.gz" } ], "0.0.3": [ { "comment_text": "", "digests": { "md5": "4498a1a3a2a5da4ae7e596e029877b89", "sha256": "19dee886b187969895a88acf7c5b37bae6e79cc2ab8c3eca7e9947c0f0cf7fb0" }, "downloads": -1, "filename": "trip-0.0.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "4498a1a3a2a5da4ae7e596e029877b89", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 24495, "upload_time": "2017-11-05T11:57:22", "url": "https://files.pythonhosted.org/packages/4c/83/808fc23ae075544791c47bbf6f1aee67620d08cb23af14254974207d4096/trip-0.0.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "0e61b1319099e14be3632e07580d658b", "sha256": "28ca345bd19bc6b6e15a130e6dad0320c628a58be51c7a5c1a7229fb23223e28" }, "downloads": -1, "filename": "trip-0.0.3.tar.gz", "has_sig": false, "md5_digest": "0e61b1319099e14be3632e07580d658b", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 20960, "upload_time": "2017-11-05T11:57:24", "url": "https://files.pythonhosted.org/packages/a7/0a/3d00113e50ea538d5291f5615be83cdde1082e6f979aa274f1b506c4967f/trip-0.0.3.tar.gz" } ], "0.0.4": [ { "comment_text": "", "digests": { "md5": "ea3d171f904b20fead112953a7dea31d", "sha256": "a56060d723ea1df42c0b0b0892c20e0cee1023cb7c4e227d6eee46a64be0c55a" }, "downloads": -1, "filename": "trip-0.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ea3d171f904b20fead112953a7dea31d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26078, "upload_time": "2017-11-10T00:42:02", "url": "https://files.pythonhosted.org/packages/21/1f/91739c76f3a6f91da421fe4a454164eb9ad2bf9c4ad42a25ea2ab144b6a6/trip-0.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e772526f09703d111234fb5f4567d66c", "sha256": "ea643380054b5fb6f958391943f50aeabe006190d03d6e6d218da94ae57d11cc" }, "downloads": -1, "filename": "trip-0.0.4.tar.gz", "has_sig": false, "md5_digest": "e772526f09703d111234fb5f4567d66c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22512, "upload_time": "2017-11-10T00:42:03", "url": "https://files.pythonhosted.org/packages/1f/48/ca3498f2ecff1bbbb6e7c3aa96357caa3e96597192451f17cfc3bd801df9/trip-0.0.4.tar.gz" } ], "0.0.5": [ { "comment_text": "", "digests": { "md5": "56c31f065c61fc85f008d47b752d7845", "sha256": "277889ee30d5656e8ce914c4233700281c3eaf113a0c55255a32e7c37c605c7f" }, "downloads": -1, "filename": "trip-0.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "56c31f065c61fc85f008d47b752d7845", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 26491, "upload_time": "2017-11-14T00:35:09", "url": "https://files.pythonhosted.org/packages/86/69/3346687c477e5c870390e9051236afec53133ab86028fc851234cc5f95a1/trip-0.0.5-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b2a742d6eff6bbfaf29a7e32b38aa97c", "sha256": "bb769994fb4bfe8c1a21b3ece0120dead1893376fa67831c9f36a7b232c1aac1" }, "downloads": -1, "filename": "trip-0.0.5.tar.gz", "has_sig": false, "md5_digest": "b2a742d6eff6bbfaf29a7e32b38aa97c", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 22821, "upload_time": "2017-11-14T00:35:11", "url": "https://files.pythonhosted.org/packages/64/2d/b283c0eb1b51084cee9219fd08e22ab30def35ac2156592429722bd8a3ef/trip-0.0.5.tar.gz" } ], "0.0.6": [ { "comment_text": "", "digests": { "md5": "f724462c5f6223aa771da27f483897a5", "sha256": "0b4a57b01dde4f5425abbde4f4a305a2913cdcfe08b1be127725a1e8d1e9d2fa" }, "downloads": -1, "filename": "trip-0.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "f724462c5f6223aa771da27f483897a5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 28990, "upload_time": "2017-12-07T04:00:11", "url": "https://files.pythonhosted.org/packages/76/9f/a2421b5104daa2db470bab7004bc68d6d93e0115d768e0f2c424cbc7b9f0/trip-0.0.6-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "d073ed1207b4df6c791b19face2a2141", "sha256": "0e0c4abeff056ddf002f3a240d0513ff6fc33cd3065e04a5cf005ff627178195" }, "downloads": -1, "filename": "trip-0.0.6.tar.gz", "has_sig": false, "md5_digest": "d073ed1207b4df6c791b19face2a2141", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 24947, "upload_time": "2017-12-07T04:00:13", "url": "https://files.pythonhosted.org/packages/1b/b3/98532eaed95e55dc2f82e9cbfaf5dbab1927d0badb14a24aababa0f46019/trip-0.0.6.tar.gz" } ], "0.0.7": [ { "comment_text": "", "digests": { "md5": "0221d8f4eb49314ad71d79dbdaa844dd", "sha256": "d267c930d82d80e215a9c0c4bfbdbc8354d81c777996609e4770e8a2b8b26130" }, "downloads": -1, "filename": "trip-0.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "0221d8f4eb49314ad71d79dbdaa844dd", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 29433, "upload_time": "2017-12-13T04:33:55", "url": "https://files.pythonhosted.org/packages/f6/01/dd534513f326546961f9d7c1e91af34195f71769feb69353036a2cc21034/trip-0.0.7-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "60d4084e5c3f9427a957f81fc9b5d1c1", "sha256": "01bfb9d9c127643512a02b2bec819983c73763779ccd1433ba61cd83966cbeca" }, "downloads": -1, "filename": "trip-0.0.7.tar.gz", "has_sig": false, "md5_digest": "60d4084e5c3f9427a957f81fc9b5d1c1", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25450, "upload_time": "2017-12-13T04:33:57", "url": "https://files.pythonhosted.org/packages/d8/80/a02de1840f9991ef79e80081c23e3b885afd940f18e352ab6d1b7261592f/trip-0.0.7.tar.gz" } ], "0.0.8": [ { "comment_text": "", "digests": { "md5": "da661648e15561425d36525cfa6c9942", "sha256": "241ea89b29cbfcec5eb23cad1da01d8f8288a779b8dd0d2d9d42c43d898aabb1" }, "downloads": -1, "filename": "trip-0.0.8-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "da661648e15561425d36525cfa6c9942", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 30213, "upload_time": "2017-12-14T08:45:25", "url": "https://files.pythonhosted.org/packages/38/bc/e2d41341acd0c0902c62012b84d0b487fd77364698c395f6843c1c44e069/trip-0.0.8-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e06340d2ce502c755ab17fde9edb1752", "sha256": "f594c568424aa8265b49a32472b3510e8bbb2df75fcc2b823451c27beefafa93" }, "downloads": -1, "filename": "trip-0.0.8.tar.gz", "has_sig": false, "md5_digest": "e06340d2ce502c755ab17fde9edb1752", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26122, "upload_time": "2017-12-14T08:45:27", "url": "https://files.pythonhosted.org/packages/7e/11/f7bbc7c5770cccc31d83e8213ca62e0db56e933d49573e5fc93b1d98b53b/trip-0.0.8.tar.gz" } ], "0.0.9": [ { "comment_text": "", "digests": { "md5": "513553915cbec4bfd1749fd9d306381c", "sha256": "ca102d43602c99f455ba2e14fbf2576aebaf3dd2dfb9e683cd4568e76adb6124" }, "downloads": -1, "filename": "trip-0.0.9-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "513553915cbec4bfd1749fd9d306381c", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 30041, "upload_time": "2018-01-16T12:58:17", "url": "https://files.pythonhosted.org/packages/ad/49/bf6178df0d17fd355f6083b198a2106ac1ce998b5e3b92f855557d29e7a9/trip-0.0.9-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "33dbdd188a5a218a2a224d916b259891", "sha256": "e256f54000f021ad4bfde019e218b2740b22314445caf2a7c8407ec375bfd09b" }, "downloads": -1, "filename": "trip-0.0.9.tar.gz", "has_sig": false, "md5_digest": "33dbdd188a5a218a2a224d916b259891", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 25998, "upload_time": "2018-01-16T12:58:19", "url": "https://files.pythonhosted.org/packages/db/50/365d039238bd58c86eb8757ae008563806a6ed1b7980c63c9d5453bc150d/trip-0.0.9.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "019b846704c37de4908b3471a276fc57", "sha256": "c60a7d291d84ee37a7343ca00276e46aa2af5d430b5d227b40a847dcb43e2ef7" }, "downloads": -1, "filename": "trip-0.0.10-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "019b846704c37de4908b3471a276fc57", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 30229, "upload_time": "2018-03-27T05:18:11", "url": "https://files.pythonhosted.org/packages/d7/e7/604bf7e9a6460fd4f4c2d108762336da6eb4f54edf4e9e99c4754984a6fe/trip-0.0.10-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "2a231ed421e3fe723113d123e939a6a6", "sha256": "61efa349f5b10b8b9b34a94897873543005b83c83e6ebf86edc906044015d008" }, "downloads": -1, "filename": "trip-0.0.10.tar.gz", "has_sig": false, "md5_digest": "2a231ed421e3fe723113d123e939a6a6", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 26117, "upload_time": "2018-03-27T05:18:12", "url": "https://files.pythonhosted.org/packages/50/25/005d1e7eb79f59c8d900b53d81713d9a1f44a7bad5cc7223adea4b09134f/trip-0.0.10.tar.gz" } ] }