Metadata-Version: 2.0
Name: tusfilter
Version: 0.5.0
Summary: python wsgi filter for tus protocol 1.0.0
Home-page: https://github.com/everydo/tusfilter
Author: easydo.cn
Author-email: info@easydo.cn
License: MIT
Keywords: tus wsgi filter
Platform: UNKNOWN
Classifier: Development Status :: 3 - Alpha
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.5
Classifier: Topic :: Internet :: WWW/HTTP
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI
Classifier: Topic :: Internet :: WWW/HTTP :: WSGI :: Middleware
Classifier: License :: OSI Approved :: MIT License
Requires-Dist: WebOb

=========
tusfilter
=========

python wsgi filter for tus protocol 1.0.0, `the tus resumable upload standard`_.

.. _the tus resumable upload standard: http://tus.io/


install
-------

::

    pip install tusfilter


Arguments
---------

app
    required, the wsgi server application

upload_path
    ``str``, required, path of the upload service

tmp_dir
    ``str``, optional, directory to store temporary files, default ``/upload``

expire
    ``int``, optional, how long before cleanup old uploads in seconds, default ``60*60*60``

send_file
    ``bool``, optional, ``False`` for send the absolute filepath in ``tmp_dir`` in the request body,
    ``True`` for an actual file uploaded, default ``False``

max_size
    ``int``, optional, maximum size of uploads in bytes, default ``2**30``, 1G


Example
-------

flask ::

    from tusfilter import TusFilter
    from flask import Flask

    app = Flask(__name__)

    @app.route("/upload_resumable/<tmpfile>", methods=['PATCH'])
    def upload_resumable(tmpfile):
        # do something else
        return 'End of upload'

    app.wsgi_app = TusFilter(
        app.wsgi_app,
        upload_path='/upload_resumable',
        tmp_dir='/tmp/upload',
    )


