Registry / aws / tuspyserver

tuspyserver

JSON →
library4.2.5pypypi✓ verified 84d ago

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 tuspyserver
INSTALL
IMPORT
SIG · TUSPYSERVER
T
tuspyserver
awspythonv4.2.5
Install
3.8s avg
Import
Disk
30MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v4.2.5 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.940 runs
installs and imports cleanly · install 0.0s · import 0.000s · 32.1MB
glibc
py 3.103.940 runs
installs and imports cleanly · install 3.8s · import 0.000s · 32MB
30MB installed
● package 30MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

create_tus_router
from tuspyserver import create_tus_router
from tuspyserver import TuspyServer

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`.

import os from fastapi import FastAPI from tuspyserver import TuspyServer, DiskStorage app = FastAPI() # Ensure the upload directory exists for DiskStorage upload_dir = os.path.join(os.getcwd(), "upload_data") os.makedirs(upload_dir, exist_ok=True) # Initialize DiskStorage. For S3Storage, use: # S3Storage( # bucket_name=os.environ.get('S3_BUCKET_NAME', 'your-s3-bucket'), # aws_access_key_id=os.environ.get('AWS_ACCESS_KEY_ID', ''), # aws_secret_access_key=os.environ.get('AWS_SECRET_ACCESS_KEY', ''), # # region_name=os.environ.get('AWS_REGION', 'us-east-1') # ) storage = DiskStorage(upload_dir) # Initialize TuspyServer with the chosen storage backend tus_server = TuspyServer(storage) # Add the TuspyServer router to your FastAPI app app.include_router(tus_server.router, prefix="/files") # Optional: Add an endpoint to list uploaded files (for demonstration) @app.get("/uploaded-files") async def list_files(): return storage.list_files() # To run this app, save it as main.py and execute: # uvicorn main:app --reload --port 8000
Debug
Known issues
breakingMajor refactor in v4.0.0 removed old storage implementations (e.g., `FileStorage`, `MemoryStorage`). Users must migrate to the new `DiskStorage` or `S3Storage` classes.
fix
Replace imports like `from tuspyserver.storage import FileStorage` with `from tuspyserver import DiskStorage` and instantiate `DiskStorage` or `S3Storage` instead.
affects: >=4.0.0
breakingPython 3.7 support was dropped in v3.0.0. The library now requires Python 3.8 or newer for compatibility.
fix
Upgrade your Python environment to 3.8 or a later version to use `tuspyserver` v3.0.0 or higher.
affects: >=3.0.0
gotchaWhen using `S3Storage`, the `boto3` library is a conditional dependency and must be installed explicitly using `pip install tuspyserver[s3]`.
fix
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.
affects: All
gotchaThe `tuspyserver` integrates as a FastAPI router, meaning your application needs to be run using an ASGI server like Uvicorn. While `uvicorn` is a dependency, you still need to know how to execute it.
fix
After creating your FastAPI application (e.g., in `main.py`), run it using `uvicorn main:app --reload` in your terminal for development.
affects: All
Upgrade
Version history
4.2.5latest on PyPI · released May 12, 2026
Audit
Dependencies
fastapirequiredCore framework for the tus server router.
uvicornrequiredASGI server for running the FastAPI application.
python-multipartrequiredRequired by FastAPI for parsing form data, especially for file uploads.
boto3optionalRequired for S3Storage backend to interact with AWS S3.
Agent activity
40 hits · last 30 days
node
38
OpenAI (training)
1
Resources
tuspyserver — pip install tuspyserver · libregistry