TuspyServer is a Python library implementing the tus.io resumable upload protocol as a FastAPI router. It provides flexible backend storage options, including local disk (DiskStorage) and AWS S3 (S3Storage). The current version is 4.2.3, and it's actively maintained with regular updates and feature enhancements.
pip install tuspyserverVerified import paths — ran on the pinned version, not inferred.
This quickstart sets up a basic `tuspyserver` instance with `DiskStorage` using FastAPI. It initializes the storage, ensures the upload directory exists, integrates the `TuspyServer` router into the FastAPI application under the `/files` prefix, and includes an example endpoint to list uploaded files. Remember to install `uvicorn` and run the app with `uvicorn main:app`.
Replace imports like `from tuspyserver.storage import FileStorage` with `from tuspyserver import DiskStorage` and instantiate `DiskStorage` or `S3Storage` instead.
Upgrade your Python environment to 3.8 or a later version to use `tuspyserver` v3.0.0 or higher.
Ensure `pip install tuspyserver[s3]` is executed if planning to utilize AWS S3 for file storage, as `boto3` is not included in the base installation.
After creating your FastAPI application (e.g., in `main.py`), run it using `uvicorn main:app --reload` in your terminal for development.