Skip to main content

PyJS Extras

pyjs-extras contains official, optional integrations between PyJS and third-party services. Install only the provider dependencies you need:

uv add "pyjs-extras[stripe]"

When the matching PyJS version is already a direct dependency, this convenience spelling is equivalent:

uv add "pyjs[stripe]"

Stripe

pyjs_extras.stripe provides five deliberately separate surfaces:

  • browser contains typed Stripe.js declarations for transpiled code.
  • web contains dependency-free SSR helpers for Stripe script and pricing table elements.
  • server adapts the official Python Stripe SDK without depending on a web framework.
  • testing provides an in-memory mock suitable for application tests.
  • simulator runs a stateful local Stripe-compatible HTTP service for complete Checkout, webhook, subscription, and customer-portal scenarios.

Business concepts such as members, entitlements, and local subscription models belong in an application or membership package rather than this integration.

Start the simulator with an application webhook destination:

uv run pyjs-stripe-simulator \
    --webhook-url http://localhost:8000/stripe/webhook/

The API uses sk_test_local, webhooks use whsec_local, and state is stored in .pyjs-stripe.sqlite3 by default. Point StripeGateway(api_base=...) at http://127.0.0.1:12111 so application code follows the same SDK path used with Stripe.

Open http://127.0.0.1:12111 for the PyJS operator dashboard. It can select successful, retryable-decline, hard-decline, or authentication-required behavior for each subscription, run renewals, retry open invoices, advance the clock, replace payment methods, and inspect invoice retry state. Webhook tools can switch between automatic, manual, and paused forwarding; deliver pending events oldest- or newest-first; send duplicate events; and inject invalid or stale signatures. Test-only JSON state, reset, and clock controls remain available under /_test/.

The simulator uses three payment attempts before marking a retryable invoice uncollectible and its subscription unpaid. See stripe/SIMULATOR.md for its lifecycle contract and deliberate limits. Product, price, amount, currency, and maximum payment attempts can be changed with command-line options; run pyjs-stripe-simulator --help for the complete list.

Metadata

Release files for pyjs-extras 0.4.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 pyjs-extras 0.4.0
File Size Uploaded
pyjs_extras-0.4.0.tar.gz 26.0 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for pyjs-extras 0.4.0
File Interpreter ABI Platform
pyjs_extras-0.4.0-py3-none-any.whl Python 3 none any Details

Total release size: 55.8 kB

Release files / pyjs_extras-0.4.0.tar.gz

Download URL pyjs_extras-0.4.0.tar.gz
Size 26.0 kB
Tags Source
SHA-256 checksum
How to use checksums
badb537f622f99505841a23224254145c680ba5aade990ed7550fa4ec9f5ff76
BLAKE2b-256 checksum
How to use checksums
53ea0a69df911c43b63b91f4db88fd36db819c41a3f4b19261f7e3b18662030c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release files / pyjs_extras-0.4.0-py3-none-any.whl

Download URL pyjs_extras-0.4.0-py3-none-any.whl
Size 29.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
a278d511a1482fb7bd94f7574aa7811e6531578a8e5332e62ca6eece901c7d94
BLAKE2b-256 checksum
How to use checksums
69ecc169f5df5be7c847d93deca3372252c2e0e7e8268deb55b3e2f129d58efb
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.14.3

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 release files

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