FastAPI extention implementing the tus server
Project description
FastAPI Server for Tus Protocol
A file upload server of the tus resumable upload protocol is implemented on FastAPI framework.
Thanks to tusd, it provides great ideas and a sensible design pattern to implement Tus
protocol to support multiple backend storage implementations.
Features:
- Basic operations to support Core Protocol such as HEAD, POST, PATCH, DELETE
- Creation With Upload
- Checksum such as md5
- Expiration
- Concatenation
- File storage
- S3 storage
Getting started
Import TusRouter
to your application,
from fastapi import FastAPI
from fastapi_tusd import TusRouter
app = FastAPI()
# `store_dir`: the folder to store uploaded files
# `location`: the API endpoint to serve, like `http://127.0.0.1:8000/files` or relative path `files` (TODO: induced from `prefix` in default)
app.include_router(TusRouter(store_dir="./files", location="/files"), prefix="/files")
Then the tus upload endpoints will be served at http://127.0.0.1:8000/files
, more information is available at http://127.0.0.1:8000/docs
Examples
There is a simple example with a web file upload client supporting for Tus
protocol, thanks to Uppy
!
Enter the example/
folder, and run(pip install
uvicornif no
uvicorn`!)
uvicorn app_tusd:app --reload
Then visit https://127.0.0.1:8000/upload.thml
References
GitHub - tus/tus-resumable-upload-protocol: Open Protocol for Resumable File Uploads
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for fastapi-tusd-0.100.1.post0.tar.gz
Algorithm | Hash digest | |
---|---|---|
SHA256 | b306f303643e107adede7def25254497a9f00ad2c6a62270cf5d3c12e2849048 |
|
MD5 | eba4cd4fccd9868618e2e9a0b22d78c5 |
|
BLAKE2b-256 | 5047c08349f028f040f42da592728c53dd8185c8423e739d0a5ca91c8c3a1dac |
Hashes for fastapi_tusd-0.100.1.post0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 49e58e31e09004071158fccbdc876675be32aa016d1732537a02dbee646d466d |
|
MD5 | 6d9656a865215ce2561b5c2511bee427 |
|
BLAKE2b-256 | cc6cc41146af60e16261d5822547227dfd808b977974f79b1898561210e865ea |