{ "info": { "author": "Andrew Crozier", "author_email": "wacrozier@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 3" ], "description": "resumable.py\n============\n\n.. image:: https://travis-ci.org/acroz/resumable.py.svg?branch=master\n :target: https://travis-ci.org/acroz/resumable.py\n.. image:: https://coveralls.io/repos/github/acroz/resumable.py/badge.svg?branch=master\n :target: https://coveralls.io/github/acroz/resumable.py?branch=master\n\nresumable.py provides chunked uploading of files to a compatible server,\nemulating the popular resumable.js_ JavaScript library.\n\nInstallation\n------------\n\nresumable.py can be installed from PyPI with ``pip``:\n\n.. code-block:: bash\n\n $ pip install resumable\n\nUsage\n-----\n\nConstruct a ``Resumable`` object with the URL of the upload target server, and\nuse ``add_file()`` to queue files for upload. It's recommended to use it as a\ncontext manager:\n\n.. code-block:: python\n\n from resumable import Resumable\n\n with Resumable('https://example.com/upload') as session:\n session.add_file('my_file.dat')\n\nYou can queue mutiple files for upload in a single session, and the ``with``\nblock will not complete until the upload is finished (or an exception is\nraised).\n\nIt's also possible to use a ``Resumable`` session without a ``with`` block, and\nmanually ``join()`` the session:\n\n.. code-block:: python\n\n session = Resumable('https://example.com/upload')\n session.add_file('my_file.dat')\n do_something_else()\n session.join()\n\nBackend\n+++++++\n\nresumable.py handles most of the logic needed for resumable file uploads on the\nclient side, but the files still need to be reassembled from chunks on the\nserver side, as in resumable.js_. For details on how to set up a compatible\nbackend, please see the resumable.js_ documentation or the backend samples\n`on GitHub `_.\n\nConfiguration\n+++++++++++++\n\nresumable.py supports a subset of the options provided by resumable.js_:\n\n* ``target`` The target URL for the multipart POST request (required)\n* ``chunk_size`` The size in bytes of each uploaded chunk of data (default:\n ``1*1024*1024``)\n* ``simultaneous_uploads`` Number of simultaneous uploads (default: ``3``)\n* ``headers`` Extra headers to include in the multipart POST with data\n (default: ``{}``)\n* ``test_chunks`` Make a GET request to the server for each chunks to see if it\n already exists. If implemented on the server-side, this will allow for upload\n resumes even after a browser crash or even a computer restart. (default:\n ``True``)\n\nSome additional low level options are available - these are documented in the\ndocstring of the ``Resumable`` class.\n\nCallbacks and Progress Reporting\n++++++++++++++++++++++++++++++++\n\nresumable.py provides the ability to register arbitrary functions as callbacks\nin response to certain events. These are:\n\nOn the ``Resumable`` object:\n\n* ``file_added`` Triggered when a file is added, with the file object\n* ``file_completed`` Triggered when a file is completed, with the file object\n* ``chunk_completed`` Triggered when a chunk is completed, with the file and\n chunk objects\n\nOn a ``ResumableFile`` (returned by ``Resumable.add_file()``):\n\n* ``completed`` Triggered when the file is completed, without arguments\n* ``chunk_completed`` Triggered when a chunk is completed, with the chunk\n object\n\nEach of these callback dispatchers has a ``register()`` method that you can use\nto register callbacks. For example, to print a simple progress message that\nupdates as chunks are uploaded:\n\n.. code-block:: python\n\n with Resumable('https://example.com/upload') as session:\n file = session.add_file('my_file.dat')\n\n def print_progress(chunk):\n template = '\\rPercent complete: {:.1%}'\n print(template.format(file.fraction_completed), end='')\n\n file.chunk_completed.register(print_progress)\n\n print() # new line\n\nContribute\n----------\n\nresumable.py's design is informed by resumable.js_, however only a core subset\nof features have yet been implemented. Patches implementing resumable.js\nfeatures are welcome, and contributors should attempt to retain consistency\nwith the resumable.js interface, mapping JavaScript style and idioms to Python\nequivalents as appropriate (for example, the ``simultaneousUploads``\nconfiguration parameter becomes ``simultaneous_uploads`` in Python).\n\n.. _resumable.js: http://resumablejs.com\n.. _resumable.js-samples: https://github.com/23/resumable.js/tree/master/samples\n", "description_content_type": null, "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://acroz.github.com/acroz/resumable.py", "keywords": "", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "resumable", "package_url": "https://pypi.org/project/resumable/", "platform": "", "project_url": "https://pypi.org/project/resumable/", "project_urls": { "Homepage": "https://acroz.github.com/acroz/resumable.py" }, "release_url": "https://pypi.org/project/resumable/0.1.1/", "requires_dist": null, "requires_python": "", "summary": "Python client for upload to a server supporting resumable.js", "version": "0.1.1" }, "last_serial": 3434981, "releases": { "0.0.0.dev0": [ { "comment_text": "", "digests": { "md5": "1689f6b11cc25152e2f649b72199cbcb", "sha256": "bc66a0cccdea9af6cc0e404061340dfab0bd37970580a5d222f7cd1a180c9b27" }, "downloads": -1, "filename": "resumable-0.0.0.dev0.tar.gz", "has_sig": false, "md5_digest": "1689f6b11cc25152e2f649b72199cbcb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 818, "upload_time": "2017-07-26T18:07:44", "url": "https://files.pythonhosted.org/packages/85/27/35760376a16f3e0ab17f2103ec863fa03818a763c85718536edea867d97c/resumable-0.0.0.dev0.tar.gz" } ], "0.1.0": [ { "comment_text": "", "digests": { "md5": "280cccd806da09751ff12650bc17dab4", "sha256": "01c31d9498d8622c08da019cddb32d4feb8ee436cc316d469b914009622dd2bd" }, "downloads": -1, "filename": "resumable-0.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "280cccd806da09751ff12650bc17dab4", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 7673, "upload_time": "2017-12-21T16:27:13", "url": "https://files.pythonhosted.org/packages/9e/92/6dbff1f012415d23381c08c196b16bbec52ef978651f645cb4040bf57294/resumable-0.1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "b9dc8e84139f0476d49a2f79d51323bb", "sha256": "13c6afe1020343be41ed023d4509ed1132dd335cba153baa970a03140b5bb44a" }, "downloads": -1, "filename": "resumable-0.1.0.tar.gz", "has_sig": false, "md5_digest": "b9dc8e84139f0476d49a2f79d51323bb", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10053, "upload_time": "2017-12-21T16:27:10", "url": "https://files.pythonhosted.org/packages/97/f2/6b46411f8a4bd29a87fab97cd8d55607086f66188e6825ea94690307a76d/resumable-0.1.0.tar.gz" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "ca6fcd72a9f99a788ac76d36c6cc1aa5", "sha256": "f20f7bea5a830abf6bef2f88009c63cb57382c4ae59d21a3494616713ba0e3a7" }, "downloads": -1, "filename": "resumable-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ca6fcd72a9f99a788ac76d36c6cc1aa5", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 11403, "upload_time": "2017-12-21T17:40:33", "url": "https://files.pythonhosted.org/packages/cd/72/f66381996e14579821a8f488e056b9223e7c58f000aaea76ddc322192488/resumable-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1139431fb254f1701adb35ad79b72b12", "sha256": "57c85753eafc617570918d2c2c24c55898cde09b110054e0dcceb689a00c9b02" }, "downloads": -1, "filename": "resumable-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1139431fb254f1701adb35ad79b72b12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12567, "upload_time": "2017-12-21T17:40:32", "url": "https://files.pythonhosted.org/packages/0b/05/9281b5783e9aa0c1b8d14d6444dd5f5aba6e9bc67d0e745754810b2f95d2/resumable-0.1.1.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "ca6fcd72a9f99a788ac76d36c6cc1aa5", "sha256": "f20f7bea5a830abf6bef2f88009c63cb57382c4ae59d21a3494616713ba0e3a7" }, "downloads": -1, "filename": "resumable-0.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "ca6fcd72a9f99a788ac76d36c6cc1aa5", "packagetype": "bdist_wheel", "python_version": "3.6", "requires_python": null, "size": 11403, "upload_time": "2017-12-21T17:40:33", "url": "https://files.pythonhosted.org/packages/cd/72/f66381996e14579821a8f488e056b9223e7c58f000aaea76ddc322192488/resumable-0.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "1139431fb254f1701adb35ad79b72b12", "sha256": "57c85753eafc617570918d2c2c24c55898cde09b110054e0dcceb689a00c9b02" }, "downloads": -1, "filename": "resumable-0.1.1.tar.gz", "has_sig": false, "md5_digest": "1139431fb254f1701adb35ad79b72b12", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12567, "upload_time": "2017-12-21T17:40:32", "url": "https://files.pythonhosted.org/packages/0b/05/9281b5783e9aa0c1b8d14d6444dd5f5aba6e9bc67d0e745754810b2f95d2/resumable-0.1.1.tar.gz" } ] }