Skip to main content

stigg-api-client

⚠️ This package has been deprecated and is no longer actively maintained. Please use stigg-api-client-v2 instead.

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.

It leverages the sgqlc library to generate Python classes for GraphQL types, and utilizes the sgqlc.endpoint.requests.RequestsEndpoint class to send the API requests. The responses are being automatically converted into native Python types.

Documentation

See https://docs.stigg.io/docs/python-sdk

Installation

pip install stigg-api-client

Usage

Initialize the client:

import os
from stigg import Stigg

api_key = os.environ.get("STIGG_SERVER_API_KEY")

stigg_client = Stigg.create_client(api_key)

Provision a customer

import os
from stigg import Stigg

api_key = os.environ.get("STIGG_SERVER_API_KEY")

client = Stigg.create_client(api_key)

data = client.request(Stigg.mutation.provision_customer, {
    "input": {
        "refId": "customer-id",
        "name": "Acme",
        "email": "hello@acme.com",
        "couponRefId": "coupon-id",
        "billingInformation": {
            "language": "en",
            "timezone": "America/New_York",
            "billingAddress": {
                "country": "US",
                "city": "New York",
                "state": "NY",
                "addressLine1": "123 Main Street",
                "addressLine2": "Apt. 1",
                "phoneNumber": "+1 212-499-5321",
                "postalCode": "10164"
            },
            "shippingAddress": {
                "country": "US",
                "city": "New York",
                "state": "NY",
                "addressLine1": "123 Main Street",
                "addressLine2": "Apt. 1",
                "phoneNumber": "+1 212-499-5321",
                "postalCode": "10164"
            }
        },
        "additionalMetaData": {
            "key": "value"
        },
        "subscriptionParams": {
            "planId": "plan-revvenu-basic"
        }
    }
})

print(data.provision_customer.customer.name)

Get a customer by ID

import os
from stigg import Stigg

api_key = os.environ.get("STIGG_SERVER_API_KEY")

client = Stigg.create_client(api_key)

data = client.request(Stigg.query.get_customer_by_id, {
  "input": {"customerId": "customer-id"}
})

customer = data.get_customer_by_ref_id
print(customer.name)

Metadata

Release files for stigg-api-client 6.26.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for stigg-api-client 6.26.0
File Size Uploaded Provenance Actions
stigg_api_client-6.26.0.tar.gz 100.9 kB Without provenance Details for stigg_api_client-6.26.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for stigg-api-client 6.26.0
File Interpreter ABI Platform Actions
stigg_api_client-6.26.0-py3-none-any.whl Python 3 none any Details for stigg_api_client-6.26.0-py3-none-any.whl

Total release size: 203.0 kB

Release files / stigg_api_client-6.26.0.tar.gz

Download URL stigg_api_client-6.26.0.tar.gz
Size 100.9 kB
Tags Source
SHA-256 checksum
How to use checksums
31c1aa892b1dba60d5275e4491543206a63dc8b1d53d5e515f2101d133abf616
BLAKE2b-256 checksum
How to use checksums
780fd89bb2376a6428953570ab532182e801ed06485ebff0c625df612b054155
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-6.26.0-py3-none-any.whl

Download URL stigg_api_client-6.26.0-py3-none-any.whl
Size 102.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
352e8ed18fcfee973af775d3d639a7dbea326b652c1ac39c193d1181ce84682b
BLAKE2b-256 checksum
How to use checksums
cb3882ac059372e8a4468764922c7666c5396fedb90c3b745a08efc929e83cca
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

Security for stigg-api-client 6.26.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

6.26.0 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page