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.25.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.25.0.tar.gz | 108.6 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| stigg_api_client_v2-6.25.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 241.1 kB
Release files / stigg_api_client_v2-6.25.0.tar.gz
| Download URL | stigg_api_client_v2-6.25.0.tar.gz |
|---|---|
| Size | 108.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
43c3f907a8171573ea2f81e0a9e3ae4507f83cbcd64df0f1eca5a857b3354eb1
|
|
BLAKE2b-256 checksum How to use checksums |
75045c47dd5818633809b452bd63b4985e74b933f8172e8101c2bc6d367f4828
|
| 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.25.0-py3-none-any.whl
| Download URL | stigg_api_client_v2-6.25.0-py3-none-any.whl |
|---|---|
| Size | 132.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
02dea90ac9a5fc143885075b5d60b9fadf5b4bd9dfc318a306c38b955318745b
|
|
BLAKE2b-256 checksum How to use checksums |
e88dc9f5b83a43d5af862240c693bf9b8ae41eb1d7fbfa8bb384386ee343fe31
|
| 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
|