Name | stigg-sidecar-sdk JSON |
Version |
3.73.0
JSON |
| download |
home_page | None |
Summary | None |
upload_time | 2025-09-08 10:49:31 |
maintainer | None |
docs_url | None |
author | Stigg |
requires_python | <4.0,>=3.9 |
license | None |
keywords |
|
VCS |
|
bugtrack_url |
|
requirements |
No requirements were recorded.
|
Travis-CI |
No Travis.
|
coveralls test coverage |
No coveralls.
|
# stigg-sidecar-sdk
Stigg Python SDK makes it easier to interact with Stigg Sidecar
## Documentation
See https://docs.stigg.io/docs/sidecar-sdk
## Installation
```shell
pip install stigg-sidecar-sdk
```
## Usage
Initialize the client:
```python
import os
from stigg_sidecar_sdk import Stigg, ApiConfig, LocalSidecarConfig, RedisOptions
api_key = os.environ.get("STIGG_SERVER_API_KEY")
stigg = Stigg(
ApiConfig(
api_key=api_key,
),
# for development purposes, configure local sidecar (spawned as a subprocess):
local_sidecar_config=LocalSidecarConfig(
redis=RedisOptions(
environment_prefix="development",
host="localhost",
port=6379,
db=0
)
),
# for production use, set remote sidecar host and port:
remote_sidecar_host='localhost',
remote_sidecar_port=80
)
```
Get single entitlement of a customer
```python
from stigg_sidecar_sdk import Stigg, ApiConfig, GetMeteredEntitlementRequest, MeteredEntitlementOptions
async def get_entitlement():
stigg = Stigg(ApiConfig(api_key='api_key'))
resp = await stigg.get_metered_entitlement(
GetMeteredEntitlementRequest(customer_id='customer-demo-01',
feature_id='feature-01-templates',
options=MeteredEntitlementOptions(requested_usage=1))
)
print(resp.entitlement.has_access)
```
Accessing the `api` client:
```python
from stigg_sidecar_sdk import Stigg, ApiConfig
from stigg.generated import ProvisionCustomerInput
async def get_entitlement():
stigg = Stigg(ApiConfig(api_key='api_key'))
resp = await stigg.api.provision_customer(
ProvisionCustomerInput(
customer_id='customer-demo-01',
name='customer-name'
)
)
print("customer created", resp.provision_customer.customer.created_at)
```
Raw data
{
"_id": null,
"home_page": null,
"name": "stigg-sidecar-sdk",
"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/fd/00/27c7c5832618d69d422c0f49d469a183e883e4e49ef64e3c146ac72a624f/stigg_sidecar_sdk-3.73.0.tar.gz",
"platform": null,
"description": "# stigg-sidecar-sdk \n\nStigg Python SDK makes it easier to interact with Stigg Sidecar\n\n## Documentation\n\nSee https://docs.stigg.io/docs/sidecar-sdk\n\n## Installation\n\n```shell\n pip install stigg-sidecar-sdk\n```\n\n## Usage\n\nInitialize the client:\n\n```python\n\nimport os\nfrom stigg_sidecar_sdk import Stigg, ApiConfig, LocalSidecarConfig, RedisOptions\n\napi_key = os.environ.get(\"STIGG_SERVER_API_KEY\")\n\nstigg = Stigg(\n ApiConfig(\n api_key=api_key,\n ),\n # for development purposes, configure local sidecar (spawned as a subprocess): \n local_sidecar_config=LocalSidecarConfig(\n redis=RedisOptions(\n environment_prefix=\"development\",\n host=\"localhost\",\n port=6379,\n db=0\n )\n ),\n # for production use, set remote sidecar host and port:\n remote_sidecar_host='localhost',\n remote_sidecar_port=80\n)\n\n```\n\nGet single entitlement of a customer\n\n```python\n\nfrom stigg_sidecar_sdk import Stigg, ApiConfig, GetMeteredEntitlementRequest, MeteredEntitlementOptions\n\n\nasync def get_entitlement():\n stigg = Stigg(ApiConfig(api_key='api_key'))\n resp = await stigg.get_metered_entitlement(\n GetMeteredEntitlementRequest(customer_id='customer-demo-01',\n feature_id='feature-01-templates',\n options=MeteredEntitlementOptions(requested_usage=1))\n )\n print(resp.entitlement.has_access) \n```\n\nAccessing the `api` client: \n\n```python\n\nfrom stigg_sidecar_sdk import Stigg, ApiConfig\nfrom stigg.generated import ProvisionCustomerInput\n\nasync def get_entitlement():\n stigg = Stigg(ApiConfig(api_key='api_key'))\n \n resp = await stigg.api.provision_customer(\n ProvisionCustomerInput(\n customer_id='customer-demo-01',\n name='customer-name'\n )\n )\n print(\"customer created\", resp.provision_customer.customer.created_at)\n```\n",
"bugtrack_url": null,
"license": null,
"summary": null,
"version": "3.73.0",
"project_urls": null,
"split_keywords": [],
"urls": [
{
"comment_text": "",
"digests": {
"blake2b_256": "3fbe476d351685720b45adfe078fb1a762d95f5ce0674fe308e902f30631f4af",
"md5": "a6266251bf486eb4673003348df8dd06",
"sha256": "fa1f209ac51390f500b0e55039dc1623c44b6e30c12ddcbd61e13de1de0fcec6"
},
"downloads": -1,
"filename": "stigg_sidecar_sdk-3.73.0-py3-none-any.whl",
"has_sig": false,
"md5_digest": "a6266251bf486eb4673003348df8dd06",
"packagetype": "bdist_wheel",
"python_version": "py3",
"requires_python": "<4.0,>=3.9",
"size": 12399,
"upload_time": "2025-09-08T10:49:30",
"upload_time_iso_8601": "2025-09-08T10:49:30.499273Z",
"url": "https://files.pythonhosted.org/packages/3f/be/476d351685720b45adfe078fb1a762d95f5ce0674fe308e902f30631f4af/stigg_sidecar_sdk-3.73.0-py3-none-any.whl",
"yanked": false,
"yanked_reason": null
},
{
"comment_text": "",
"digests": {
"blake2b_256": "fd0027c7c5832618d69d422c0f49d469a183e883e4e49ef64e3c146ac72a624f",
"md5": "5518090a3eb993219a9e213f7139a52c",
"sha256": "431945bd3a9a3040a6a0c73cd24db882df019e32a7c755dac9b84fd641483aad"
},
"downloads": -1,
"filename": "stigg_sidecar_sdk-3.73.0.tar.gz",
"has_sig": false,
"md5_digest": "5518090a3eb993219a9e213f7139a52c",
"packagetype": "sdist",
"python_version": "source",
"requires_python": "<4.0,>=3.9",
"size": 11635,
"upload_time": "2025-09-08T10:49:31",
"upload_time_iso_8601": "2025-09-08T10:49:31.386151Z",
"url": "https://files.pythonhosted.org/packages/fd/00/27c7c5832618d69d422c0f49d469a183e883e4e49ef64e3c146ac72a624f/stigg_sidecar_sdk-3.73.0.tar.gz",
"yanked": false,
"yanked_reason": null
}
],
"upload_time": "2025-09-08 10:49:31",
"github": false,
"gitlab": false,
"bitbucket": false,
"codeberg": false,
"lcname": "stigg-sidecar-sdk"
}