Skip to main content

A Python SDK and CLI tool for creating, managing, and interacting with Morph Cloud VMs.

Project description

MorphCloud Python SDK

Overview

MorphCloud is a platform designed to spin up remote AI devboxes we call runtimes. It provides a suite of code intelligence tools and a Python SDK to manage, create, delete, and interact with runtime instances.

Setup Guide

Prerequisites

Python 3.11 or higher

Go to https://cloud.morph.so, log in with the provided credentials and create an API key.

Set the API key as an environment variable MORPH_API_KEY.

Installation

pip install morphcloud

Export the API key:

export MORPH_API_KEY="your-api-key"

Quick Start

To start using MorphCloud, you can create and manage runtime instances using the provided classes and methods. Here's a basic example to create a runtime instance:

from morphcloud.api import MorphCloudClient

client = MorphCloudClient()

snapshot = client.snapshots.create(vcpus=1, memory=128, disk_size=700, image_id="morphvm-minimal")
instance = client.instances.start(snapshot_id=snapshot.id)

print(instance.exec("echo 'Hello, World!'").stdout)

Command Line Interface

The SDK also provides a command line interface to interact with the MorphCloud API. You can use the CLI to create, delete, and manage runtime instances.

morphcloud snapshot list
morphcloud instance create

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

morphcloud-0.1.12.tar.gz (32.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

morphcloud-0.1.12-py3-none-any.whl (35.2 kB view details)

Uploaded Python 3

File details

Details for the file morphcloud-0.1.12.tar.gz.

File metadata

  • Download URL: morphcloud-0.1.12.tar.gz
  • Upload date:
  • Size: 32.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for morphcloud-0.1.12.tar.gz
Algorithm Hash digest
SHA256 6b2a663295de430ef7d7cef52a742bd13bf083cdfb60a271f0cfcf2942767bf1
MD5 62001a473199dd1bc16abd8fb9c425a3
BLAKE2b-256 f9e94387b39dbc8f9844d82f34972cdf9f8c2cb8c18daf363f30b1619edefb1d

See more details on using hashes here.

File details

Details for the file morphcloud-0.1.12-py3-none-any.whl.

File metadata

  • Download URL: morphcloud-0.1.12-py3-none-any.whl
  • Upload date:
  • Size: 35.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.11.10

File hashes

Hashes for morphcloud-0.1.12-py3-none-any.whl
Algorithm Hash digest
SHA256 455db85e369b1c4700f6194e2b290b92948b0e77065b4554b5a06a439c222969
MD5 e855857c349a0c284da984c3383e3fed
BLAKE2b-256 e12ab752e50f2848410cfd51b18eb9becb472eb704cf9c600e04aaf01fdcffe4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page