{ "info": { "author": "Nathan Van Gheem", "author_email": "nathan@vangheem.us", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python", "Topic :: Internet :: WWW/HTTP", "Topic :: Internet :: WWW/HTTP :: WSGI :: Application" ], "description": "tus python integration\n======================\n\nThis package aims to be a robust implementation of the tus resumable upload\nstandard, `tus.io `_.\n\nIntegrations include an api to handle WebOb requests and Zope2 requests.\nAdditionally, you can run this server as a wsgi filter.\n\nThe package aims to be everything you need to integrate the TUS protocol\ninto your python web applications.\n\n\nOptions\n-------\n\ntmp_file_dir\n directory to store temporary files\nsend_file\n by default, it'll only send the filename in the request body,\n not an actual file upload\nupload_valid_duration\n how long before you cleanup old uploads in seconds\nupload_path\n only used for WSGI filter\n\n\nBasics\n------\n\n1. POST to url, response 201 with location of temp file upload url. The\n upload url is a combination of the base url + the unique id of the in\n progress file upload. Example: /upload/432jjdsfjsd78387\n\n2. PATCH to temp file upload url responded to in previous POST. These can be\n chunks of the entire file.\n\nResume\n~~~~~~\n\n- HEAD to issued temp file upload url to give current size of uploaded\n\n\nIntegration\n===========\n\n\nWebOb compatible applications\n-----------------------------\n\nA simple Webob request adapter is provided to work with the API. This code\nassume it will be handling all upload related requests--meaning::\n\n from tus import Tus, WebobAdapter\n adapter = WebobAdapter(req)\n options = {\n 'tmp_file_dir': '/tmp'\n }\n tus = Tus(adapter, **options)\n if tus.valid:\n tus.handle()\n if tus.upload_finished:\n fipath = tus.get_filepath()\n # do something here\n tus.cleanup_file()\n else:\n return adapter.resp\n\n\nZope2 or Plone\n--------------\n\nThis example is taken out of\n`plone.app.widgets `_::\n\n\n adapter = Zope2RequestAdapter(req)\n tus = Tus(adapter, **tus_settings)\n if tus.valid:\n tus.handle()\n if not tus.upload_finished:\n return\n else:\n filename = req.getHeader('FILENAME')\n if tus.send_file:\n filedata = req._file\n else:\n filepath = req._file.read()\n filedata = open(filepath)\n tus.cleanup_file()\n\n\nWSGI Filter\n-----------\n\nExample in python::\n\n from tus import Filter as TusFilter\n filtered = TusFilter(app, tmp_file_dir='/tmp', upload_path='/upload')\n\n\nWSGI Paste Configuration Example\n--------------------------------\n\nBasic paste deploy config::\n\n [app:main]\n use = egg:MyEgg\n filter-with = tus\n\n [filter:tus]\n use = egg:tus#main\n upload_path = /upload\n tmp_file_dir = /tmp\n\n\nor::\n\n\n [filter:tus]\n use = egg:tus#main\n upload_path = /upload\n tmp_file_dir = /tmp\n\n [app:main]\n pipeline =\n tus\n egg:MyEgg\n\n\n\n\n0.0\n---\n\n- Initial version", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": "web pyramid pylons", "license": "UNKNOWN", "maintainer": null, "maintainer_email": null, "name": "tus", "package_url": "https://pypi.org/project/tus/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/tus/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/tus/1.0a1/", "requires_dist": null, "requires_python": null, "summary": "tus", "version": "1.0a1" }, "last_serial": 976827, "releases": { "1.0a1": [ { "comment_text": "", "digests": { "md5": "e276f0d9b46c5a77eaede454fc4e0cbe", "sha256": "26f86352a9dd7f52351f54ead80d79a469378c442ce97dd5ef99160dffaba816" }, "downloads": -1, "filename": "tus-1.0a1.zip", "has_sig": false, "md5_digest": "e276f0d9b46c5a77eaede454fc4e0cbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17707, "upload_time": "2014-01-22T04:58:05", "url": "https://files.pythonhosted.org/packages/ed/88/bbc06ee5e9512a9bd8316e94c19583b756f040a5ccebce7c4ffc52fd8f19/tus-1.0a1.zip" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "e276f0d9b46c5a77eaede454fc4e0cbe", "sha256": "26f86352a9dd7f52351f54ead80d79a469378c442ce97dd5ef99160dffaba816" }, "downloads": -1, "filename": "tus-1.0a1.zip", "has_sig": false, "md5_digest": "e276f0d9b46c5a77eaede454fc4e0cbe", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 17707, "upload_time": "2014-01-22T04:58:05", "url": "https://files.pythonhosted.org/packages/ed/88/bbc06ee5e9512a9bd8316e94c19583b756f040a5ccebce7c4ffc52fd8f19/tus-1.0a1.zip" } ] }