Skip to content

Python SDK Reference

from synapse import Cell
MethodDescription
Cell(**opts)Create a new cell
Cell.create(**opts)Async factory method
Cell.connect(id)Attach to existing cell
Cell.list()List all cells
MethodDescription
cell.run(code, **opts)Execute code (blocking or streaming)
cell.command(cmd, **opts)Run shell command
cell.terminal()WebSocket PTY
MethodDescription
cell.write_file(path, content)Write a file
cell.read_file(path)Read a file
cell.list_files(path)List directory
cell.file_exists(path)Check existence
cell.file_info(path)File metadata
cell.remove_file(path)Remove file/dir
cell.make_dir(path)Create directory
cell.rename_file(old, new)Rename/move
MethodDescription
cell.git.clone(url)Clone repository
cell.git.status()Working tree status
cell.git.add(path)Stage files
cell.git.commit(msg)Commit changes
cell.git.push()Push to remote
…and 14 moreSee Git Integration
MethodDescription
cell.kill()Destroy the cell
cell.pause()Pause + snapshot
cell.resume()Resume
cell.set_timeout(s)Set timeout
cell.keep_alive(s)Reset timer
cell.get_info()Get SandboxInfo
PropertyTypeDescription
cell.cell_idstrUnique cell ID
cell.templatestrRuntime template
cell.persistentboolPersistence flag
cell.executionsintExecution count