Skip to main content

Stax Python SDK

Project description

Stax SDK for Python

staxapp is the Stax Software Development Kit (SDK) for Python, allowing users to interact with the Stax platform.

codecov build deploy PyPI - Python Version

Authentication

In order to use the Stax SDK for Python, you will need a valid Stax API Token.

Installation

Install the package using pip:

pip install staxapp

Configure environment variables:

export STAX_REGION=au1.staxapp.cloud
export STAX_ACCESS_KEY=<your_access_key>
export STAX_SECRET_KEY=<your_secret_key>

Optional configuration:

Authentication token expiry

Allows configuration of the threshold to when the Auth library should re-cache the credentials Suggested use when running within CI/CD tools to reduce overall auth calls

export TOKEN_EXPIRY_THRESHOLD_IN_MINS=2 # Type: Integer representing minutes

Usage

Read Accounts

The following code can be used to read accounts within your Stax Organisation:

import json
import os

from staxapp.config import Config
from staxapp.openapi import StaxClient

Config.access_key = os.getenv("STAX_ACCESS_KEY")
Config.secret_key = os.getenv("STAX_SECRET_KEY")

# Read all accounts within your Stax Organisation
accounts = StaxClient("accounts")
response = accounts.ReadAccounts()
print(json.dumps(response, indent=4, sort_keys=True))

# Read all active accounts within your Stax Organisation and include tags in the response
accounts = StaxClient("accounts")
response = accounts.ReadAccounts(filter="ACTIVE", include_tags=True)
print(json.dumps(response, indent=4, sort_keys=True))

Contributing

For more information on contributing the to the Stax SDK, please see our guide.

Getting Help

  • If you're having trouble using the Stax SDK, please refer to our documentation.
  • If you've encountered an issue or found a bug, please open an issue.
  • For any other requests, please contact Stax support.

Project details


Download files

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

Files for staxapp, version 1.1.3
Filename, size File type Python version Upload date Hashes
Filename, size staxapp-1.1.3-py3-none-any.whl (37.2 kB) File type Wheel Python version py3 Upload date Hashes View
Filename, size staxapp-1.1.3.tar.gz (16.9 kB) File type Source Python version None Upload date Hashes View

Supported by

AWS AWS Cloud computing Datadog Datadog Monitoring DigiCert DigiCert EV certificate Facebook / Instagram Facebook / Instagram PSF Sponsor Fastly Fastly CDN Google Google Object Storage and Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Salesforce Salesforce PSF Sponsor Sentry Sentry Error logging StatusPage StatusPage Status page