stigg-api-client-v2
This library provides a Python wrapper to Stigg's GraphQL API based on the operations that are in use by the Stigg's Node.js SDK.
The ariadne-codegen code generator is used to generate a typesafe Python API client.
Documentation
TBD
Installation
pip install stigg-api-client-v2
Usage
Initialize the client:
import os
from stigg import Stigg
api_key = os.environ.get("STIGG_SERVER_API_KEY")
client = Stigg.create_async_client(api_key)
Provision a customer
import os
from stigg import Stigg
from stigg.generated import ProvisionCustomerInput
api_key = os.environ.get("STIGG_SERVER_API_KEY")
client = Stigg.create_async_client(api_key)
customer_input = ProvisionCustomerInput(
**{
"customer_id": "1661115567186116608", # mandatory, everything else is optional
"name": "Acme",
"email": "billing@acme.com",
"additional_meta_data": {"key": "value"},
"subscription_params": {"plan_id": "plan-acme-free"},
}
)
result = await client.provision_customer(customer_input)
print(result.provision_customer.customer)
Get a customer by ID
import os
from stigg import Stigg
from stigg.generated import GetCustomerByRefIdInput
api_key = os.environ.get("STIGG_SERVER_API_KEY")
client = Stigg.create_async_client(api_key)
result = await client.get_customer_by_id(GetCustomerByRefIdInput(**{"customer_id": "1661115567186116608"}))
print(result.get_customer_by_ref_id.name)
Metadata
Release files for stigg-api-client-v2 6.24.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| stigg_api_client_v2-6.24.0.tar.gz | 108.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stigg_api_client_v2-6.24.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 240.6 kB
Release files / stigg_api_client_v2-6.24.0.tar.gz
| Download URL | stigg_api_client_v2-6.24.0.tar.gz |
|---|---|
| Size | 108.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
9fcd021959f7334b50332ef25d92eafe0c9d95b9584197abe533569fef37a8aa
|
|
BLAKE2b-256 checksum How to use checksums |
9df07332ba7d6ef1a85a79036cb859aaa4201e1ad76aa6fdcf40fa13676d30bd
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.10.12 Linux/6.6.141
|
Release files / stigg_api_client_v2-6.24.0-py3-none-any.whl
| Download URL | stigg_api_client_v2-6.24.0-py3-none-any.whl |
|---|---|
| Size | 132.2 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8dbbbd8604f5bd839fc3492ce347c01b98966fa96b9ebf1e2ba14c6ce2732817
|
|
BLAKE2b-256 checksum How to use checksums |
b6eb2b775db5b14b27c363665a5e6b70299b631d805f9b313c56a21177dceb1f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.4.0 CPython/3.10.12 Linux/6.6.141
|