Skip to content

Python SDK Reference

The Synodes Python SDK provides a robust interface for programmatically interacting with Synodes Sandboxes.

Installation

Install the Synodes Python SDK using pip:

Terminal window
pip install synodes

Or using poetry:

Terminal window
poetry add synodes

Getting Started

Here’s a simple example to help you get started with the Synodes Python SDK:

from synodes import Synodes
def main():
# Initialize the SDK (uses environment variables by default)
synodes = Synodes()
# Create a new sandbox
sandbox = synodes.create()
# Execute a command
response = sandbox.process.exec("echo 'Hello, World!'")
print(response.result)
if __name__ == "__main__":
main()

Configuration

The SDK can be configured using environment variables or by passing options to the constructor:

from synodes import Synodes, SynodesConfig
# Using environment variables (SYNODES_API_KEY, SYNODES_API_URL, SYNODES_TARGET)
synodes = Synodes()
# Using explicit configuration
config = SynodesConfig(
api_key="your-api-key",
api_url="https://app.synodes.io/api",
target="us"
)
synodes = Synodes(config)