# stigg-api-client-v2 (BETA)
This library provides a Python wrapper to [Stigg's GraphQL API](https://docs.stigg.io/docs/graphql-api) based on
the operations that are in use by the [Stigg's Node.js SDK](https://docs.stigg.io/docs/nodejs-sdk).
The [ariadne-codegen](https://github.com/mirumee/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:
```python
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
```python
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
```python
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)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "stigg-api-client-v2",
"maintainer": null,
"docs_url": null,
"requires_python": "<4.0,>=3.9",
"maintainer_email": null,
"keywords": null,
"author": "Stigg",
"author_email": "support@stigg.io",
"download_url": "https://files.pythonhosted.org/packages/c0/64/4b326dfd7e464c1e3ac3b29ff806a4a760fdac4df20456b986dc53af0152/stigg_api_client_v2-2.319.0.tar.gz",
"platform": null,
"description": "# stigg-api-client-v2 (BETA)\n\nThis library provides a Python wrapper to [Stigg's GraphQL API](https://docs.stigg.io/docs/graphql-api) based on \nthe operations that are in use by the [Stigg's Node.js SDK](https://docs.stigg.io/docs/nodejs-sdk).\n\nThe [ariadne-codegen](https://github.com/mirumee/ariadne-codegen) code generator is used to generate a typesafe Python API client.\n\n## Documentation\n\nTBD\n\n## Installation\n\n pip install stigg-api-client-v2\n\n## Usage\n\nInitialize the client:\n\n```python\n\nimport os\nfrom stigg import Stigg\n\napi_key = os.environ.get(\"STIGG_SERVER_API_KEY\")\n\nclient = Stigg.create_async_client(api_key)\n\n```\n\nProvision a customer\n\n```python\n\n\n\nimport os\nfrom stigg import Stigg\nfrom stigg.generated import ProvisionCustomerInput\n\napi_key = os.environ.get(\"STIGG_SERVER_API_KEY\")\n\nclient = Stigg.create_async_client(api_key)\n\ncustomer_input = ProvisionCustomerInput(\n **{\n \"customer_id\": \"1661115567186116608\", # mandatory, everything else is optional\n \"name\": \"Acme\",\n \"email\": \"billing@acme.com\",\n \"additional_meta_data\": {\"key\": \"value\"},\n \"subscription_params\": {\"plan_id\": \"plan-acme-free\"},\n }\n)\nresult = await client.provision_customer(customer_input)\n\nprint(result.provision_customer.customer)\n\n```\n\nGet a customer by ID\n\n```python\n\nimport os\nfrom stigg import Stigg\nfrom stigg.generated import GetCustomerByRefIdInput\n\napi_key = os.environ.get(\"STIGG_SERVER_API_KEY\")\n\nclient = Stigg.create_async_client(api_key)\n\nresult = await client.get_customer_by_id(GetCustomerByRefIdInput(**{\"customer_id\": \"1661115567186116608\"}))\n\nprint(result.get_customer_by_ref_id.name)\n\n```\n",
"bugtrack_url": null,
"license": "STIGG SDK LICENSE",
"summary": null,
"version": "2.319.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "bf5d4c2e6e20155518d34b9cb69a82b4d3e1e7e4e02cd38c21127bba026500d3",
"md5": "0b850eb33f747b2034c3a4679feff4fb",
"sha256": "be646b56e1cc6828114369ffd4ca013494b6df579e8fe689aaaeb318b62cc50a"
},
"downloads": -1,
"filename": "stigg_api_client_v2-2.319.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "0b850eb33f747b2034c3a4679feff4fb",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 500620,
"upload_time": "2025-03-09T13:00:16",
"upload_time_iso_8601": "2025-03-09T13:00:16.683256Z",
"url": "https://files.pythonhosted.org/packages/bf/5d/4c2e6e20155518d34b9cb69a82b4d3e1e7e4e02cd38c21127bba026500d3/stigg_api_client_v2-2.319.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "c0644b326dfd7e464c1e3ac3b29ff806a4a760fdac4df20456b986dc53af0152",
"md5": "59917c04bafcdf419bca6ffcdc5fbbf1",
"sha256": "9a211e340a65ae8ee0714218257b92180885c6a0cd87bba5095ed65f7339367e"
},
"downloads": -1,
"filename": "stigg_api_client_v2-2.319.0.tar.gz",
"has_sig": false,
"md5_digest": "59917c04bafcdf419bca6ffcdc5fbbf1",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 435314,
"upload_time": "2025-03-09T13:00:18",
"upload_time_iso_8601": "2025-03-09T13:00:18.737212Z",
"url": "https://files.pythonhosted.org/packages/c0/64/4b326dfd7e464c1e3ac3b29ff806a4a760fdac4df20456b986dc53af0152/stigg_api_client_v2-2.319.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-03-09 13:00:18",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "stigg-api-client-v2"
}