Shadow SDK — Python client for Shadow server REST API and Socket.IO real-time events
Project description
Shadow Python SDK
Python client for the Shadow server REST API and Socket.IO real-time events.
Installation
pip install shadowob-sdk
Quick Start
from shadowob_sdk import ShadowClient, ShadowSocket
# REST API
client = ShadowClient("https://shadowob.com", token="your-jwt-token")
me = client.get_me()
print(f"Logged in as {me['username']}")
# Send a message
msg = client.send_message("channel-id", "Hello from Python!")
print(f"Sent message: {msg['id']}")
# Real-time events
socket = ShadowSocket("https://shadowob.com", token="your-jwt-token")
socket.on("message:new", lambda msg: print(f"New message: {msg['content']}"))
socket.connect()
socket.join_channel("channel-id")
socket.wait() # Block until disconnected
Commerce Automation
from shadowob_sdk import ShadowClient
client = ShadowClient("https://shadowob.com", token="your-jwt-token")
# Buyer-facing product context includes product, shop, provider, delivery, refund,
# credit, and asset homepage links.
context = client.get_commerce_product_context("product-id")
# Preview an offer, then purchase with an idempotency key.
preview = client.get_commerce_offer_checkout_preview("offer-id")
if preview["nextAction"] == "purchase":
client.purchase_commerce_offer(
"offer-id",
idempotency_key="checkout-20260518-001",
)
# External provider apps use an OAuth access token for app-scoped entitlements.
app_client = ShadowClient("https://shadowob.com", token="oauth-access-token")
access = app_client.get_oauth_commerce_entitlement_access(
resource_id="oauth-app-id:premium",
)
if access["allowed"]:
app_client.redeem_oauth_commerce_entitlement(
resource_id="oauth-app-id:premium",
idempotency_key="provider-delivery-001",
)
API Reference
See the full documentation for complete API reference.
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
shadowob_sdk-1.1.6.tar.gz
(23.4 kB
view details)
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 shadowob_sdk-1.1.6.tar.gz.
File metadata
- Download URL: shadowob_sdk-1.1.6.tar.gz
- Upload date:
- Size: 23.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
458b8896d24d6dd4abc62bdd2e5efb13095cb47780e4428b3a093c020ad3a5bd
|
|
| MD5 |
689a3214a6dcdca1480c580b25c05a94
|
|
| BLAKE2b-256 |
f3cd3845c256205d5f86adcd1a2d635d5fc3662f949897ba4ac00d1fd3b72584
|
File details
Details for the file shadowob_sdk-1.1.6-py3-none-any.whl.
File metadata
- Download URL: shadowob_sdk-1.1.6-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e226aaa811d3bcfaacad0293da49100067209cf9aefb680ebfb8b31bc9cb5fc0
|
|
| MD5 |
6383222a1400baa5c9092abc18f8889e
|
|
| BLAKE2b-256 |
6e716fe14f4661c91c07ce3734cd4225c66e60fd91993ad006566d618c0454e8
|