import io
from gravixlayer import GravixLayer
client = GravixLayer()
runtime = client.runtime.create(template="python-3.14-base-small")
# Upload from a file-like object (any binary stream)
buffer = io.BytesIO(b"hello from local upload\n")
response = runtime.file.upload_file(buffer, path="/workspace/local-file.txt")
print(response.message)
print(response.path)
print(response.size)
# Or upload bytes/string directly with `upload` (no file handle required)
runtime.file.upload("/workspace/notes.txt", b"plain text bytes\n")
runtime.kill()