Supertab Connect SDK
Project description
Supertab Connect SDK
Python SDK for Supertab Connect.
Use this package to obtain Supertab license tokens on the customer side and verify or enforce them on the merchant side.
Installation
pip install supertab-connect-sdk
Requires Python 3.12 or newer.
Customer Usage
Obtain a license token for a resource URL:
import asyncio
from supertab_connect import obtain_license_token
async def main() -> None:
token = await obtain_license_token(
client_id="your_client_id",
client_secret="your_client_secret",
resource_url="https://example.com/premium/article",
)
if token is None:
print("No token required for this usage")
return
print(token)
asyncio.run(main())
The SDK fetches license.xml from the resource origin, finds the best matching
<content> entry, and exchanges the client credentials for a license token.
Merchant Usage
Verify and record license-token usage:
import asyncio
from supertab_connect import SupertabConnect, SupertabConnectConfig
async def main() -> None:
client = SupertabConnect(
SupertabConnectConfig(
api_key="your_api_key",
)
)
async with client:
result = await client.verify_and_record(
token="your.jwt.token",
resource_url="https://example.com/premium/article",
user_agent="Mozilla/5.0",
request_headers={"Accept": "text/html"},
)
if not result.valid:
print(f"DENY access: {result.error}")
return
print("ALLOW access")
asyncio.run(main())
For request-level enforcement, use SupertabConnect.handle_request() with an
httpx.Request. See the examples directory for complete merchant and customer
examples.
Error Handling
Customer-side token retrieval raises SupertabConnectError when license.xml
cannot be fetched or parsed, no matching content block exists, or the token
endpoint fails.
Merchant-side token verification returns typed result objects instead of raising for normal invalid-token cases. Invalid tokens include a reason and a human readable error.
Typing
This package ships inline type hints and includes a py.typed marker for type
checkers.
Documentation
See the Supertab Connect Python SDK docs for the full API reference.
Development
This project uses hatchling as the build backend.
See DEVELOPMENT.md for local setup, Git hooks, and CI-aligned development commands.
Links
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 supertab_connect_sdk-0.1.0.tar.gz.
File metadata
- Download URL: supertab_connect_sdk-0.1.0.tar.gz
- Upload date:
- Size: 27.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
147d002a24a22fa0121144eeed5bf561d3f882334fc15b58698de63caa9a302f
|
|
| MD5 |
dcd3de28b3df1581c1dbf7c4b1c85197
|
|
| BLAKE2b-256 |
4221d3f5c9edc1259a125c99ffe41522ea71dbc9cf9c88094489bb216e94a8aa
|
Provenance
The following attestation bundles were made for supertab_connect_sdk-0.1.0.tar.gz:
Publisher:
publish-pypi.yml on getsupertab/connect-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
supertab_connect_sdk-0.1.0.tar.gz -
Subject digest:
147d002a24a22fa0121144eeed5bf561d3f882334fc15b58698de63caa9a302f - Sigstore transparency entry: 1402682795
- Sigstore integration time:
-
Permalink:
getsupertab/connect-sdk-python@4463a1ce57fa6405475718a2c41c03f9ee20ee65 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/getsupertab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4463a1ce57fa6405475718a2c41c03f9ee20ee65 -
Trigger Event:
push
-
Statement type:
File details
Details for the file supertab_connect_sdk-0.1.0-py3-none-any.whl.
File metadata
- Download URL: supertab_connect_sdk-0.1.0-py3-none-any.whl
- Upload date:
- Size: 22.3 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
f7f49ee17d4a50ec3c09434f81b974a072726e471a58cb4d97b932f2e234f326
|
|
| MD5 |
8f69fef08180201725b9ba39798a0840
|
|
| BLAKE2b-256 |
bbcbe0909b6410e288c5b9919c3c4643041d8b53fa2ddad3c67980ab87efb2b5
|
Provenance
The following attestation bundles were made for supertab_connect_sdk-0.1.0-py3-none-any.whl:
Publisher:
publish-pypi.yml on getsupertab/connect-sdk-python
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
supertab_connect_sdk-0.1.0-py3-none-any.whl -
Subject digest:
f7f49ee17d4a50ec3c09434f81b974a072726e471a58cb4d97b932f2e234f326 - Sigstore transparency entry: 1402683094
- Sigstore integration time:
-
Permalink:
getsupertab/connect-sdk-python@4463a1ce57fa6405475718a2c41c03f9ee20ee65 -
Branch / Tag:
refs/tags/v0.1.0 - Owner: https://github.com/getsupertab
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish-pypi.yml@4463a1ce57fa6405475718a2c41c03f9ee20ee65 -
Trigger Event:
push
-
Statement type: