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.

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyjs_extras-0.4.0.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.

pyjs_extras-0.4.0-py3-none-any.whl (29.8 kB view details)

Uploaded Python 3

File details

Details for the file pyjs_extras-0.4.0.tar.gz.

File metadata

  • Download URL: pyjs_extras-0.4.0.tar.gz
  • Upload date:
  • Size: 26.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for pyjs_extras-0.4.0.tar.gz
Algorithm Hash digest
SHA256 badb537f622f99505841a23224254145c680ba5aade990ed7550fa4ec9f5ff76
MD5 cfcb5dde82016318a6da1204f43efd0a
BLAKE2b-256 53ea0a69df911c43b63b91f4db88fd36db819c41a3f4b19261f7e3b18662030c

See more details on using hashes here.

File details

Details for the file pyjs_extras-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: pyjs_extras-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 29.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/7.0.0 CPython/3.14.3

File hashes

Hashes for pyjs_extras-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 a278d511a1482fb7bd94f7574aa7811e6531578a8e5332e62ca6eece901c7d94
MD5 20b207b90fe8bb152273c1c025ef14a1
BLAKE2b-256 69ecc169f5df5be7c847d93deca3372252c2e0e7e8268deb55b3e2f129d58efb

See more details on using hashes here.

Release history Release notifications | RSS feed

This release

0.4.0 This release

2 files

Supported by

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