Skip to main content

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


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.16.tar.gz (26.0 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

shadowob_sdk-1.1.16-py3-none-any.whl (21.4 kB view details)

Uploaded Python 3

File details

Details for the file shadowob_sdk-1.1.16.tar.gz.

File metadata

  • Download URL: shadowob_sdk-1.1.16.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for shadowob_sdk-1.1.16.tar.gz
Algorithm Hash digest
SHA256 241e8aed28a6aded11acaa0ca75da9b9e35ceb73873d03e82eedc04eb38ca746
MD5 8905da0d48003ed9d45e82a130ac1783
BLAKE2b-256 8a2c645d984f6a4df288418bf2494cc6d7e855650052e5b0c976589e22f17a30

See more details on using hashes here.

File details

Details for the file shadowob_sdk-1.1.16-py3-none-any.whl.

File metadata

  • Download URL: shadowob_sdk-1.1.16-py3-none-any.whl
  • Upload date:
  • Size: 21.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.13

File hashes

Hashes for shadowob_sdk-1.1.16-py3-none-any.whl
Algorithm Hash digest
SHA256 26b1e5ebb25312ded496c5379427c9aabf0aaafdc9c4526b73a110ae006be895
MD5 a21d53f3f40590b00d6e1bf77c0ab702
BLAKE2b-256 8d5135e090ade3e1a6f7fd2ebe8c4d96dc06628844089397dfa0703b52d579b9

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page