stigg-api-client-v2


Namestigg-api-client-v2 JSON
Version 1.190.3 PyPI version JSON
download
home_pageNone
SummaryNone
upload_time2024-05-23 19:32:02
maintainerNone
docs_urlNone
authorStigg
requires_python<4.0,>=3.9
licenseSTIGG SDK LICENSE
keywords
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            # 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/6e/bb/1a22fa0815dbe836cb7eb6eb456242f149d4bf1eff5ca404f5198aa2ae60/stigg_api_client_v2-1.190.3.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": "1.190.3",
    "project_urls": null,
    "split_keywords": [],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "8c89e87db3479e2fb1cd4164f14f6336b695a80181ce6039601dfe43fa10dbc7",
                "md5": "1f2f9026ca8fc9d435f16ad0b8a10d61",
                "sha256": "0e2e8382c7b30176bd9c27d0cff5ce594d0c89796a26586fd174b0e5232b067a"
            },
            "downloads": -1,
            "filename": "stigg_api_client_v2-1.190.3-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "1f2f9026ca8fc9d435f16ad0b8a10d61",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": "<4.0,>=3.9",
            "size": 488380,
            "upload_time": "2024-05-23T19:31:58",
            "upload_time_iso_8601": "2024-05-23T19:31:58.468946Z",
            "url": "https://files.pythonhosted.org/packages/8c/89/e87db3479e2fb1cd4164f14f6336b695a80181ce6039601dfe43fa10dbc7/stigg_api_client_v2-1.190.3-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "6ebb1a22fa0815dbe836cb7eb6eb456242f149d4bf1eff5ca404f5198aa2ae60",
                "md5": "811acd161e4277b9b5c9a912e62e03e4",
                "sha256": "dc6bb2f478b4b86ef595955562b6018a9e6154728eaaa362893d62d69c3de534"
            },
            "downloads": -1,
            "filename": "stigg_api_client_v2-1.190.3.tar.gz",
            "has_sig": false,
            "md5_digest": "811acd161e4277b9b5c9a912e62e03e4",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": "<4.0,>=3.9",
            "size": 425073,
            "upload_time": "2024-05-23T19:32:02",
            "upload_time_iso_8601": "2024-05-23T19:32:02.270699Z",
            "url": "https://files.pythonhosted.org/packages/6e/bb/1a22fa0815dbe836cb7eb6eb456242f149d4bf1eff5ca404f5198aa2ae60/stigg_api_client_v2-1.190.3.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-05-23 19:32:02",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "stigg-api-client-v2"
}
        
Elapsed time: 0.30482s