tuspy is a Python client library for the tus resumable upload protocol (http://tus.io). It allows developers to reliably upload large files over HTTP, resuming interrupted uploads from where they left off. The current version is 1.1.0, and the library receives active maintenance with releases addressing bug fixes and minor feature enhancements.
pip install tuspyVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to initialize a `TusClient` and perform a synchronous file upload using the `Uploader`. It creates a dummy file if one doesn't exist and attempts to upload it to a specified tus server endpoint. Remember to set the `TUS_SERVER_ENDPOINT` environment variable or replace it directly.
Upgrade to Python 3.5.3+ to use tuspy v1.0.0 and newer versions.
For async: `from tusclient.asyncclient import AsyncClient, AsyncUploader`; `async_client = AsyncClient(endpoint)`; `async_uploader = async_client.async_uploader(...)`; `await async_uploader.upload()`.
Experiment with different `chunk_size` values. Default is 2MB (2 * 1024 * 1024 bytes). Consult your tus server documentation for optimal or maximum chunk sizes.
Verify the endpoint URL with your tus server's documentation. It should typically be a base path where new upload requests are initiated, not a specific file's URL.
pip install tuspy
Ensure the tus server URL is correct, the server is running, and accessible from the client's network.
Verify the `tus_url` is correct and that the tus server is configured to handle the request properly; check server logs for specific details. ```python from tuspy import client tus_url = 'http://your-correct-tus-server/files/' # Ensure this is correct my_client = client.TusClient(tus_url=tus_url) # ... rest of your upload logic ... ```
Ensure the server's SSL certificate is valid and trusted by the client's system. Alternatively, for non-production environments, disable SSL verification by passing `verify_ssl=False` to `TusClient`. ```python from tuspy import client tus_url = 'https://your-tus-server/files/' # For trusted certificates: my_client = client.TusClient(tus_url=tus_url) # For untrusted/self-signed certificates (use with caution in production): # my_client = client.TusClient(tus_url=tus_url, verify_ssl=False) ```
No dependency data recorded yet.