No project description provided
Project description
stigg-api-client-v2 (BETA)
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)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file stigg_api_client_v2-2.415.0.tar.gz.
File metadata
- Download URL: stigg_api_client_v2-2.415.0.tar.gz
- Upload date:
- Size: 435.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.12.3 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
dbe2aa8fd17c2a1e5a3cfd938bac18179e0955193d3f485d634bfd6c846d6742
|
|
| MD5 |
4604fae39eec8348ea4438337ab5920d
|
|
| BLAKE2b-256 |
c88770e45eeba553af577f3a22142908e544c71118696f04f33be6d4776d13fd
|
File details
Details for the file stigg_api_client_v2-2.415.0-py3-none-any.whl.
File metadata
- Download URL: stigg_api_client_v2-2.415.0-py3-none-any.whl
- Upload date:
- Size: 501.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.4.0 CPython/3.12.3 Linux/6.11.0-1015-azure
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
15b97d78f1076162321de550963627f0a5a5bf048e00ff38a3d9b9558caa86d4
|
|
| MD5 |
e4dde474252da3d52b5c750d4a526c68
|
|
| BLAKE2b-256 |
c588312fb89ba4fd0d52d5a21a1048058724ae005df4263bf51689fae3224c64
|