Python SDK Quickstart

Welcome to the Python SDK quickstart guide! This guide will walk you through the essential steps to get started with our Python SDK, allowing you to integrate our services into your Python applications quickly and efficiently.

Prerequisites

Before you begin, ensure you have the following:

Installation

The easiest way to install the Python SDK is by using pip, the Python package installer. Open your terminal or command prompt and run the following command:

pip install myapp-sdk

This command will download and install the latest version of the SDK and its dependencies.

Basic Usage

Once installed, you can start using the SDK in your Python scripts. Here's a simple example of how to initialize the client and make a basic call:

1

Import the SDK

First, import the necessary client class from the SDK.

from myapp_sdk import MyAppClient
2

Initialize the Client

You'll need your API key to initialize the client. It's recommended to store your API key in an environment variable for security.

Security Note: Never hardcode your API key directly into your code.
import os

api_key = os.environ.get("MYAPP_API_KEY")
client = MyAppClient(api_key=api_key)

If you don't have the environment variable set, you can pass the key directly (for testing purposes only):

client = MyAppClient(api_key="YOUR_API_KEY")
3

Make Your First Call

Now you can use the client object to interact with our services. For example, let's retrieve some basic information:

try:
    user_info = client.user.get_profile()
    print(f"Welcome, {user_info['username']}!")
except Exception as e:
    print(f"An error occurred: {e}")

Next Steps

Congratulations! You've successfully set up and used the Python SDK.