Skip to main content

session_jupyter

Show session geometry in a Jupyter notebook with the session viewer. One function, no paths:

from session_py import Line, Session
from session_jupyter import show

session = Session("net")
session.add_line(Line(0, 0, 0, 1, 0, 0))

show(session, "my_net")

With upload rights, show uploads the session to the viewer's storage (Cloudflare R2, bucket session-viewer-data) as the scene my_net and returns a frame with https://petrasvestartas.github.io/session/?scene=view_my_net.yaml. Run the cell again and the open viewer reloads.

Call What it does
show(session, name) with upload rights: upload as name; without: send to the upload service (one day)
show(session, name, upload=True) always upload, then show the viewer in the notebook
show(session, name, view="top", height=700) choose the opening camera (top, front, iso, …) and the frame height
show(session, name, upload=False) only show the scene already published under that name
publish(session, name) upload and return the viewer address
share(session) send it to the upload service, no keys, kept one day; return the viewer address
inline_url(session) the viewer address that carries the session itself, nothing uploaded
url(name) the viewer address of a published scene

Install

pip install session-jupyter

Every change to session_jupyter/ on main is released by .github/workflows/session-jupyter-publish.yml. For development inside the session monorepo, beside session_py:

uv pip install -e session_jupyter

Without keys: the upload service

Students have no keys. show(session, name) then sends the scene to the upload service in worker/, a Cloudflare Worker anyone may call, also from a browser notebook on a Chromebook:

  • each scene is stored under the hash of its content (tmp/<hash>.pb and tmp/<hash>.yaml in the bucket session-viewer-data), so the same scene is stored once, however often a cell runs. canonical() gives the objects fixed ids first, because every run makes new random ones;
  • the bucket deletes everything under tmp/ one day after it was last sent;
  • a body may be at most 10 MB.

SESSION_UPLOAD is the service address (default https://session-upload.petrasvestartas.workers.dev/upload). When the service cannot be reached, the geometry travels inside the frame's address instead (inline_url).

Put the service online once (from worker/):

wrangler login
wrangler deploy
wrangler r2 bucket lifecycle add session-viewer-data tmp-one-day tmp/ --expire-days 1

Upload rights

Uploading needs the [r2] profile in ~/.aws/credentials, the same one bash/view_put.sh uses. Without it, and always in a browser notebook (JupyterLite), show uploads nothing: the geometry travels inside the frame's address (#session=...) to the viewer at INLINE_VIEWER, which draws it in the page. Every student sees their own result, with no paths and no keys. show(..., upload=True) without the profile raises a clear error; upload=False still shows what is published.

A scene name is a public address and the storage keeps no history of the scene file: publishing a name again replaces what that name showed. The geometry itself is stored under its content hash and is never overwritten.

Settings

SESSION_VIEWER, R2_BUCKET, R2_ACCOUNT, R2_ENDPOINT, R2_PUBLIC, R2_PROFILE and R2_NOTIFY, SESSION_UPLOAD and INLINE_VIEWER environment variables replace the defaults; they match bash/lib/view.sh.

Metadata

Release files for session-jupyter 0.2.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 session-jupyter 0.2.0
File Size Uploaded Provenance Actions
session_jupyter-0.2.0.tar.gz 28.5 kB With provenance Details for session_jupyter-0.2.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for session-jupyter 0.2.0
File Interpreter ABI Platform Actions
session_jupyter-0.2.0-py3-none-any.whl Python 3 none any Details for session_jupyter-0.2.0-py3-none-any.whl

Total release size: 35.4 kB

Release files / session_jupyter-0.2.0.tar.gz

Download URL session_jupyter-0.2.0.tar.gz
Size 28.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3cb296d41afacf80dc8bad91f8c1fe34e7f7f91184c3049b09b78d6bdf8bf886
BLAKE2b-256 checksum
How to use checksums
2082a5c5601412f40829d88b9a6713fb4a78fced3882f0ad23630af8cee0c669
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Release files / session_jupyter-0.2.0-py3-none-any.whl

Download URL session_jupyter-0.2.0-py3-none-any.whl
Size 6.9 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7e70c1ba3cb2bc8349d28949188e967a1e4a86c7103c6f791895fec4bd37b8d7
BLAKE2b-256 checksum
How to use checksums
3f1bc7bba7652aa60d4e065d3571c941d7c78afd586f202d9e78646784f8d272
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

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 Nov 11, 2026.

Transparency log

Security for session-jupyter 0.2.0

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 session_jupyter-0.2.0.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 Nov 11, 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.

Release history Release notifications | RSS feed

This release

0.2.0 This release

2 release files Full provenance

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