Docs

Python SDK

The Python SDK is a wrapper around the REST API and allows you to easily integrate the Up2Share Platform into your Python backend.

https://github.com/up2share/python-sdk

Requirements

  • Python 3.6+

Installation

pip install u2s_sdk

Usage

from u2s_sdk.handler import ResumableUploadHandler
from u2s_sdk.client import ApiClient

api_key = 'your_api_key'
api_client = ApiClient('https://api.up2sha.re', api_key=api_key, timeout=60)

handler = ResumableUploadHandler(api_client)

file_name = 'your_file.mp4'
file_path = 'path/to/your/file/your_file.mp4'
chunk_size = 1048576  # 1 MB

with open(file_path, 'rb') as file:
    handler.simulate_chunk_upload(file, chunk_size, filename=file_name)