Skip to main content
What you’ll learn:
  • How to install the Metorial Python SDK
  • How to make requests to the Metorial API using the SDK
Before you start:External resources:
1

Install the SDK

To install the Metorial Python SDK, use pip install:
pip install metorial
2

Using the SDK

To use the SDK, import the Metorial class and create an instance with your API key:
from metorial import Metorial

metorial = Metorial(
  api_key="$$SECRET_TOKEN$$"
)
You can now use the metorial instance to make requests to the Metorial API.
3

Making Requests

To make a request, use the resource methods on the metorial instance:
# Get a server by ID
server = metorial.servers.get('srv_Rm4Mnheq2bfEPhBhP7SY')

# Update a server instance
result = metorial.server_implementations.update('svi_Rm4Mnheq2bfEPhBhP7SY', {
  "name": "updated name",
  "description": "updated description"
})
4

Using Types

The SDK is typed and includes type definitions for all API resources, so you can benefit from type checking and IntelliSense support.