Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/okumy/aiohttp-tus
tus.io protocol implementation for aiohttp.web applications
https://github.com/okumy/aiohttp-tus
aiohttp aiohttp-server python-3 python-3-6 python-3-7 python-3-8 python-library tus tus-protocol
Last synced: about 1 month ago
JSON representation
tus.io protocol implementation for aiohttp.web applications
- Host: GitHub
- URL: https://github.com/okumy/aiohttp-tus
- Owner: okumy
- License: bsd-3-clause
- Created: 2020-03-06T12:02:15.000Z (over 4 years ago)
- Default Branch: master
- Last Pushed: 2022-12-08T12:52:47.000Z (almost 2 years ago)
- Last Synced: 2024-10-07T22:41:19.994Z (about 1 month ago)
- Topics: aiohttp, aiohttp-server, python-3, python-3-6, python-3-7, python-3-8, python-library, tus, tus-protocol
- Language: Python
- Homepage: https://www.okumy.com/
- Size: 881 KB
- Stars: 16
- Watchers: 1
- Forks: 7
- Open Issues: 5
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGELOG.rst
- License: LICENSE
Awesome Lists containing this project
README
===========
aiohttp-tus
===========.. image:: https://github.com/pylotcode/aiohttp-tus/workflows/ci/badge.svg
:target: https://github.com/pylotcode/aiohttp-tus/actions?query=workflow%3A%22ci%22
:alt: CI Workflow.. image:: https://img.shields.io/badge/pre--commit-enabled-brightgreen?logo=pre-commit&logoColor=white
:target: https://github.com/pre-commit/pre-commit
:alt: pre-commit.. image:: https://img.shields.io/badge/code%20style-black-000000.svg
:target: https://github.com/psf/black
:alt: black.. image:: https://img.shields.io/pypi/v/aiohttp-tus.svg
:target: https://pypi.org/project/aiohttp-tus/
:alt: Latest Version.. image:: https://img.shields.io/pypi/pyversions/aiohttp-tus.svg
:target: https://pypi.org/project/aiohttp-tus/
:alt: Python versions.. image:: https://img.shields.io/pypi/l/aiohttp-tus.svg
:target: https://github.com/pylotcode/aiohttp-tus/blob/master/LICENSE
:alt: BSD License.. image:: https://readthedocs.org/projects/aiohttp-tus/badge/?version=latest
:target: http://aiohttp-tus.readthedocs.org/en/latest/
:alt: Documentation`tus.io `_ server implementation for
`aiohttp.web `_ applications.For uploading large files, please consider using
`aiotus `_ (Python 3.7+) library instead.- Works on Python 3.6+
- Works with aiohttp 3.5+
- BSD licensed
- Latest documentation `on Read The Docs
`_
- Source, issues, and pull requests `on GitHub
`_Quickstart
==========Code belows shows how to enable tus-compatible uploads on ``/uploads`` URL for
``aiohttp.web`` application. After upload, files will be available at ``../uploads``
directory... code-block:: python
from pathlib import Path
from aiohttp import web
from aiohttp_tus import setup_tusapp = setup_tus(
web.Application(),
upload_url="/uploads",
upload_path=Path(__file__).parent.parent / "uploads",
)Chunk Size
==========Please, make sure to configure ``client_max_size`` for ``aiohttp.web`` Application and
supply proper ``chunkSize`` for Uppy.io or other tus.io client.`Documentation `__
CORS Headers
============To setup CORS headers you need to use `cors_middleware `_
from `aiohttp-middlewares`_ package. `aiohttp-cors `_
library not supported cause of
`aio-libs/aiohttp-cors#241 `_
issue.`Documentation `__
.. _aiohttp-middlewares: https://pypi.org/project/aiohttp-middlewares/
Reverse proxy and HTTPS
=======================When ``aiohttp`` application deployed under the reverse proxy (such as nginx) with HTTPS
support, it is needed to use `https_middleware `_
from `aiohttp-middlewares`_ package to ensure that ``web.Request`` instance has proper
schema.`Documentation `__
Examples
========`examples/ `_ directory
contains several examples, which illustrate how to use ``aiohttp-tus`` with some tus.io
clients, such as `tus.py `_ and
`Uppy.io `_.