{ "info": { "author": "Thomas Kluyver", "author_email": "thomas@kluyver.me.uk", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License" ], "description": "A convenient function to download to a file using requests.\n\nBasic usage:\n\n.. code-block:: python\n\n url = \"https://github.com/takluyver/requests_download/archive/master.zip\"\n download(url, \"requests_download.zip\")\n\nAn optional ``headers=`` parameter is passed through to requests.\n\n**Trackers** are a lightweight way to monitor the data being downloaded.\nTwo trackers are included:\n\n- ``ProgressTracker`` - displays a progress bar, using the `progressbar2\n `_ package.\n- ``HashTracker`` - wraps a hashlib object to calculate a hash (e.g. sha256 or\n md5) of the file as you download it.\n\nHere's an example of using both of them:\n\n.. code-block:: python\n\n import hashlib\n # progressbar is provided by progressbar2 on PYPI.\n from progressbar import DataTransferBar\n from requests_download import download, HashTracker, ProgressTracker\n\n hasher = HashTracker(hashlib.sha256())\n progress = ProgressTracker(DataTransferBar())\n\n download('https://github.com/takluyver/requests_download/archive/master.zip',\n 'requests_download.zip', trackers=(hasher, progress))\n\n assert hasher.hashobj.hexdigest() == '...'\n\nTo make your own tracker, subclass TrackerBase and define any of these methods:\n\n.. code-block:: python\n\n from requests_download import TrackerBase\n\n class MyTracker(TrackerBase):\n def on_start(self, response):\n \"\"\"Called with requests.Response object, which has response headers\"\"\"\n pass\n\n def on_chunk(self, chunk):\n \"\"\"Called multiple times, with bytestrings of data received\"\"\"\n pass\n\n def on_finish(self):\n \"\"\"Called when the download has completed\"\"\"\n pass\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://www.github.com/takluyver/requests_download", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "requests_download", "package_url": "https://pypi.org/project/requests_download/", "platform": "", "project_url": "https://pypi.org/project/requests_download/", "project_urls": { "Homepage": "https://www.github.com/takluyver/requests_download" }, "release_url": "https://pypi.org/project/requests_download/0.1.2/", "requires_dist": [ "requests" ], "requires_python": "", "summary": "Download files using requests and save them to a target path", "version": "0.1.2" }, "last_serial": 3414633, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "5d1cfe61a8032a939733a63ce469b36d", "sha256": "4669535b7be7cacccba36d3b8b53868cdeb97710639e7e6e7de2d0eab5aaf51f" }, "downloads": -1, "filename": "requests_download-0.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "5d1cfe61a8032a939733a63ce469b36d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2009, "upload_time": "2016-01-05T18:04:29", "url": "https://files.pythonhosted.org/packages/f7/69/e665af31de9fa84a74e3849e91d51c96f2e25dfad0c22e1be7fbe3ee882c/requests_download-0.1-py2.py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "2aae03a3fe10261ae82688107f3afdc5", "sha256": "07832a93314bcd619aaeb08611ae245728e66672efb930bc2a300a115a47dab7" }, "downloads": -1, "filename": "requests_download-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2aae03a3fe10261ae82688107f3afdc5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 2006, "upload_time": "2016-05-02T15:11:51", "url": "https://files.pythonhosted.org/packages/60/af/10f899f0574a81cbc511124c08d7c7dc46c20d4f956a6a3c793ad4330bb4/requests_download-0.1.1-py2.py3-none-any.whl" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "55cfe46eb54086d21af217f408f4f6d5", "sha256": "994d9d332befae6616f562769bab163f08d6404dc7e28fb7bfed4a0a43a754ad" }, "downloads": -1, "filename": "requests_download-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "55cfe46eb54086d21af217f408f4f6d5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5504, "upload_time": "2017-12-13T21:45:15", "url": "https://files.pythonhosted.org/packages/ad/a6/48f0af75cc62dc0b57013820d76c453962dc9ba1fffcfe4381b810b691bb/requests_download-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56f5163d97f6043056db89d314e83ad8", "sha256": "92d895a6ca51ea51aa42bab864bddaee31b5601c7e7e1ade4c27b0eb6695d846" }, "downloads": -1, "filename": "requests_download-0.1.2.tar.gz", "has_sig": false, "md5_digest": "56f5163d97f6043056db89d314e83ad8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2898, "upload_time": "2017-12-13T21:45:16", "url": "https://files.pythonhosted.org/packages/34/9d/431a25538f158a3065a76a6311f40b7908f88a4d24efdbb0ca24f83bd614/requests_download-0.1.2.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "55cfe46eb54086d21af217f408f4f6d5", "sha256": "994d9d332befae6616f562769bab163f08d6404dc7e28fb7bfed4a0a43a754ad" }, "downloads": -1, "filename": "requests_download-0.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "55cfe46eb54086d21af217f408f4f6d5", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 5504, "upload_time": "2017-12-13T21:45:15", "url": "https://files.pythonhosted.org/packages/ad/a6/48f0af75cc62dc0b57013820d76c453962dc9ba1fffcfe4381b810b691bb/requests_download-0.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "56f5163d97f6043056db89d314e83ad8", "sha256": "92d895a6ca51ea51aa42bab864bddaee31b5601c7e7e1ade4c27b0eb6695d846" }, "downloads": -1, "filename": "requests_download-0.1.2.tar.gz", "has_sig": false, "md5_digest": "56f5163d97f6043056db89d314e83ad8", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 2898, "upload_time": "2017-12-13T21:45:16", "url": "https://files.pythonhosted.org/packages/34/9d/431a25538f158a3065a76a6311f40b7908f88a4d24efdbb0ca24f83bd614/requests_download-0.1.2.tar.gz" } ] }