{ "info": { "author": "Igor Velme , Andrey Kasatov", "author_email": "ivelmey@gmail.com", "bugtrack_url": null, "classifiers": [], "description": "Python-resumable\n================\n\nWell, in order to explain what is Python-resumable we have to explain\nwhat is ResumableJS. ResumableJS is a JavaScript library providing\nmultiple simultaneous, stable and resumable uploads via the HTML5 File\nAPI. And python-resumable is a universal hookup for resumablejs. We'd\nlike to create an interface that works regardless of which framework you\nuse.\n\nIt has a universal hookup, that takes chunks as base64 strings, and\ncurrently it has a Flask-specific hookup that takes Flask file objects.\nWe'd like to add Pyramid and Django hooks.\n\nUsage\n=====\n\nIt's rather simple to use. It has to take 5 Resumable headers, your\nupload and tmp directory and file data as well.\n\nHere's a simple Flask example.\n\n.. code:: python\n\n\n from flask import Flask, request, jsonify\n from python_resumable import FlaskUploader\n\n\n app = Flask(__name__)\n\n @app.route('/uploads', methods=['GET'])\n def check_status():\n \"\"\"This route works with get checks from resumable\"\"\"\n\n request = flask.request\n\n resumable_dict = {\n 'resumableIdentifier': request.form.get('resumableIdentifier'),\n 'resumableFilename': request.form.get('resumableFilename'),\n 'resumableTotalSize': request.form.get('resumableTotalSize'),\n 'resumableTotalChunks': request.form.get('resumableTotalChunks'),\n 'resumableChunkNumber': request.form.get('resumableChunkNumber')\n }\n\n resumable = FlaskUploader(resumable_dict,\n settings.UPLOAD_FOLDER_PROJECTS,\n settings.UPLOAD_FOLDER_TMP,\n flask.request.files['file'])\n\n if resumable.chunk.exists() is True:\n return jsonify({\"chunkUploadStatus\": True})\n\n return jsonify({\"chunkUploadStatus\": False})\n\n\n @app.route('/uploads', methods=['POST'])\n def upload_file():\n request = flask.request\n\n resumable_dict = {\n 'resumableIdentifier': request.form.get('resumableIdentifier'),\n 'resumableFilename': request.form.get('resumableFilename'),\n 'resumableTotalSize': request.form.get('resumableTotalSize'),\n 'resumableTotalChunks': request.form.get('resumableTotalChunks'),\n 'resumableChunkNumber': request.form.get('resumableChunkNumber')\n }\n\n resumable = FlaskUploader(resumable_dict,\n '/home/user/uploads',\n '/home/user/tmp',\n flask.request.files['file'])\n\n resumable.upload_chunk()\n\n if resumable.check_status() is True:\n resumable.assemble_chunks()\n return jsonify({\"fileUploadStatus\": True,\n \"resumableIdentifier\": resumable.repo.file_id})\n\n return jsonify({\"chunkUploadStatus\": True,\n \"resumableIdentifier\": resumable.repo.file_id})\n\nWell... As simple as it could actually get with Resumable.\n\nMini-reference\n==============\n\nThis package provides you with two usable classes -- Uploader and\nFlaskUploader. They are essentially identical, except for the type of\nchunk-data they take.\n\nArguments on creation:\n\n- ``resumable_dict``: contains Resumable data in a dictionary form,\n namely:\n ``'resumableIdentifier', 'resumableFilename', 'resumableTotalSize', 'resumableTotalChunks', 'resumableChunkNumber'``\n- ``upload_dir``: contains path to your final directory where the file\n will be assembled.\n- ``tmp_dir``: contains path to temporary directory, where it will\n store the chunks.\n- ``chunk_data``: contains data transfered with the chunk. Uploader\n takes generic b64 strings, FlaskUploader takes Flask file objects.\n\nAttributes:\n\n- ``Chunk``: Stores chunk-related data. For full inforamtion -- refer\n to the full reference.\n- ``Repository``: Stores data related to the end file. For full\n inforamtion -- refer to the full reference.\n\nMethods:\n\n- ``upload_chunk``: If chunk already exists returns False, else saves\n chunk to ``tmp_dir/resumableId/chunk_name`` and returns True.\n- ``check_status``: If all chunks are in tmp returns True, else returns\n False.\n- ``assemble_chunks``: Assembles all of the chunks in your\n ``upload_dir``. If filename is not specified uses resumableFilename.\n- ``cleanup``: Deletes all the data from ``tmp_dir/resumableId``.\n\nFull reference can be found in docstrings.\n\nLinks\n=====\n\n- `ResumableJS `__\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/Reriiru/python-resumable", "keywords": "resumablejs", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "python-resumable", "package_url": "https://pypi.org/project/python-resumable/", "platform": "", "project_url": "https://pypi.org/project/python-resumable/", "project_urls": { "Homepage": "https://github.com/Reriiru/python-resumable" }, "release_url": "https://pypi.org/project/python-resumable/0.1.2/", "requires_dist": [ "natsort" ], "requires_python": ">=3", "summary": "Hook for working with resumable.js", "version": "0.1.2" }, "last_serial": 3214451, "releases": { "0.1": [ { "comment_text": "", "digests": { "md5": "8d2364300d081958170ab5f02660427a", "sha256": "1451a3e3354c32829e2e2f676d278e581a0595391df3d62de8fb89e9a3439939" }, "downloads": -1, "filename": "python_resumable-0.1-py3-none-any.whl", "has_sig": false, "md5_digest": "8d2364300d081958170ab5f02660427a", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 4978, "upload_time": "2017-09-30T03:03:19", "url": "https://files.pythonhosted.org/packages/66/85/3915c98c509f947b2716eedc7c95ca300b8017f32781c4a2f231a2f11f29/python_resumable-0.1-py3-none-any.whl" } ], "0.1.1": [ { "comment_text": "", "digests": { "md5": "5dba91bc9256be35c1f80b57c281895b", "sha256": "716a049c6a6b532219fc86192b5aa0f1da8ec46e3fe3980faef5e8cfdef15e05" }, "downloads": -1, "filename": "python_resumable-0.1.1-py3-none-any.whl", "has_sig": false, "md5_digest": "5dba91bc9256be35c1f80b57c281895b", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7843, "upload_time": "2017-09-30T03:16:36", "url": "https://files.pythonhosted.org/packages/87/20/576556be07dcd46328224156b19c01b01216549d6e768cc37ae1ad106cd4/python_resumable-0.1.1-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a3d587fc6182e053b2645be0de2d1fa6", "sha256": "d41ac18ad444b8faaf81b0bea4d475189c29b190c170582c926f38f16f50bd91" }, "downloads": -1, "filename": "python_resumable-0.1.1.tar.gz", "has_sig": false, "md5_digest": "a3d587fc6182e053b2645be0de2d1fa6", "packagetype": "sdist", "python_version": "source", "requires_python": ">=3", "size": 4590, "upload_time": "2017-09-30T03:16:38", "url": "https://files.pythonhosted.org/packages/5b/a3/b3bcfa167e0a1cdf7f7c5ee9d57b92d66181bc2c79c5f4ab4d5841c1fb68/python_resumable-0.1.1.tar.gz" } ], "0.1.2": [ { "comment_text": "", "digests": { "md5": "e891b536e05514c8fd2b651e61ca95dd", "sha256": "f99983d6ffe87dd7a2d57df9be9633202cfeb726d871f27a9976011767d23b6a" }, "downloads": -1, "filename": "python_resumable-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "e891b536e05514c8fd2b651e61ca95dd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7903, "upload_time": "2017-09-30T03:22:55", "url": "https://files.pythonhosted.org/packages/25/af/bec154c64a4da60d8eeaa4024b339fd8198500ed01b5c10856081e5d37c8/python_resumable-0.1.2-py3-none-any.whl" } ], "0.1rc0": [ { "comment_text": "", "digests": { "md5": "27a32935a03766991f9c382262c99e78", "sha256": "2004f675a11381ba3f216794a796d2d6d54fe94fd1ba50f9dc4939860f7d4bf9" }, "downloads": -1, "filename": "python_resumable-0.1rc0-py3-none-any.whl", "has_sig": false, "md5_digest": "27a32935a03766991f9c382262c99e78", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7857, "upload_time": "2017-09-30T03:09:01", "url": "https://files.pythonhosted.org/packages/9f/6e/f1d903ccc299312767c97402a460f38f66e06a983af152c25503e8fa643e/python_resumable-0.1rc0-py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e891b536e05514c8fd2b651e61ca95dd", "sha256": "f99983d6ffe87dd7a2d57df9be9633202cfeb726d871f27a9976011767d23b6a" }, "downloads": -1, "filename": "python_resumable-0.1.2-py3-none-any.whl", "has_sig": false, "md5_digest": "e891b536e05514c8fd2b651e61ca95dd", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": ">=3", "size": 7903, "upload_time": "2017-09-30T03:22:55", "url": "https://files.pythonhosted.org/packages/25/af/bec154c64a4da60d8eeaa4024b339fd8198500ed01b5c10856081e5d37c8/python_resumable-0.1.2-py3-none-any.whl" } ] }