Skip to main content

Configuration

Settings and configuration for the Satcat SDK, such as credentials and timeouts, can be configured in three different ways:

Configuration File

The recommended way for most users to configure the Satcat SDK is through a JSON configuration file. By setting values in this file, you can set any of the configurations exposed in the satcat.sdk.settings module.

By default, the SDK looks in your current directory for a file called config.json. However, you can set the SATCAT_CONFIG_PATH variable in your shell environment to tell the SDK to load an explicit config file.

To use the configuration file, you can set a key in the config.json for any of the fields available in satcat.sdk.settings. For example, to configure the auth_client_id and auth_client_secret variables in a config file, you can set:

    {
"auth_client_id": "<api key client id>"
"auth_client_secret": "<api key secret>"
}

Environment Variables

You can also set any field in satcat.sdk.settings using environment variables. To set a given field, you can set an environment variable with the setting's name in caps prefixed with the string SATCAT_. For example, to configure the auth_client_id and auth_client_secret variables via environment variables, you can set:

    SATCAT_AUTH_CLIENT_ID="<api key client id>"
SATCAT_AUTH_CLIENT_SECRET="<api key client secret>"

Python Code

You can also directly set any field in satcat.sdk.settings at runtime in a Python script which uses the Satcat SDK. For example, to configure the auth_client_id and auth_client_secret variables, you can use:

    satcat.sdk.settings.settings.auth_client_id = "<api key client id>"
satcat.sdk.settings.settings.auth_client_secret = "<api key client secret>"

Authentication

Because the Satcat SDK is an API client for the Satcat API suite, use of the Satcat SDK requires authentication with the Satcat platform. You will need an API key to authenticate with the Satcat SDK. API keys can be created an managed in the Satcat Control Center.

Use the following settings to connect your API key with the Satcat SDK:

  • settings.auth_method = "client_credentials"
  • settings.auth_id = "<your client id>"
  • settings.auth_secret = "<your client secret>"