For uploading bytes directly you can do the following:
bytes
from io import BytesIO drive_file = drive.CreateFile(folder_metadata) drive_file.content = BytesIO(data_bytes) drive_file.Upload()