Skip to main content

Jupyter SMART on FHIR

Prototype extensions for loading credentials in Jupyter contexts via SMART on FHIR.

This package contains two implementations:

  • server_extension: a Jupyter server extension that acts as public client for a SMART server.
  • hub_service: a JupyterHub service that acts as confidential client for a SMART server and performs asymmetric authentication.

Check the READMEs in the example folders for more information.

This package is very much a work in progress.

Server Extension

The Server extension is enabled by default on install. It registers the following handlers:

  • {base_url}/smart-on-fhir/launch - the launch URL to provide
  • {base_url}/smart-on-fhir/login (an intermediate implementation-detail handler that may go away)
  • {base_url}/smart-on-fhir/callback - the OAuth callback you'll want to register

When deployed in JupyterHub, register the URLs https://jupyterhub.example.org/hub/user-redirect/smart-on-fhir/launch as the launch URL and https://jupyterhub.example.org/hub/user-redirect/smart-on-fhir/callback as the oauth callback URL.

After SMART launch, the token info will be stored in jupyter_runtime_dir() / "smart_token.json" (also available to notebooks as $SMART_TOKEN_FILE), and in $SMART_TOKEN. $SMART_TOKEN will only be available to notebooks started after

Currently, only one token is stored at a time, so if there are multiple smart launches to a single notebook server, only the latest will be persisted.

Configure SMARTExtensionApp in jupyter_server_config.py:

c.SMARTExtensionApp.scopes = ["openid", "fhirUser", "launch", "patient/*.*"]
c.SMARTExtensionApp.client_id = "your-client-id"

see sourcecode in server_extension.py for now for more options.

Server Extension Authentication

By setting:

c.ServerApp.identity_provider_class = "jupyter_smart_on_fhir.server_extension.SMARTIdentityProvider"

the SMART launch process will be used to authenticate access to all of Jupyter Server. Only browsers that have completed the SMART launch process will be able to make any requests to the server, and the latest SMART launch token may be used as a Bearer token to communicate with the Jupyter Server.

JupyterHub Service

The JupyterHub service is a bare proof of concept which completes the SMART flow and fetches some sample data, it is not useful yet.

Metadata

Release files for jupyter-smart-on-fhir 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for jupyter-smart-on-fhir 0.2.1
File Size Uploaded Provenance Actions
jupyter_smart_on_fhir-0.2.1.tar.gz 22.2 kB With provenance Details for jupyter_smart_on_fhir-0.2.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for jupyter-smart-on-fhir 0.2.1
File Interpreter ABI Platform Actions
jupyter_smart_on_fhir-0.2.1-py3-none-any.whl Python 3 none any Details for jupyter_smart_on_fhir-0.2.1-py3-none-any.whl

Total release size: 34.6 kB

Release files / jupyter_smart_on_fhir-0.2.1.tar.gz

Download URL jupyter_smart_on_fhir-0.2.1.tar.gz
Size 22.2 kB
Tags Source
SHA-256 checksum
How to use checksums
fad1883605b3d5e6911d9f6b94c101487db89b466b4d8656a9c9e15f0ed84347
BLAKE2b-256 checksum
How to use checksums
2cb1acf6d6e6e427d6e4583a0ffb4e5847948514ba126c72783fef1900f988ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Release files / jupyter_smart_on_fhir-0.2.1-py3-none-any.whl

Download URL jupyter_smart_on_fhir-0.2.1-py3-none-any.whl
Size 12.4 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7886c4ec68d5bc2f36169bffc7c3ee4e4d31244d0d1d928653e8c2226865425c
BLAKE2b-256 checksum
How to use checksums
aa72fb08c57415741673436ecca5baac1790b6437938aa35371ce85630d540ba
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/6.1.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

Security for jupyter-smart-on-fhir 0.2.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for jupyter_smart_on_fhir-0.2.1.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 8, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

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