Skip to main content

JupyterLab extension to save the active notebook as a sibling Python script.

Project description

jupyterlab-save-py

PyPI License: MIT

jupyterlab-save-py is a JupyterLab 4 prebuilt frontend extension that adds a notebook toolbar button and command palette item named Save .py.

The command converts the active .ipynb notebook to a sibling .py file on the same Jupyter server using JupyterLab's built-in contents API. It does not run a separate service and does not install a Jupyter Server extension.

Features

  • JupyterLab 4.x prebuilt frontend extension
  • Toolbar button labeled Save .py for notebooks
  • Command palette command labeled Save .py
  • Saves next to the active notebook with the same basename and .py extension
  • Uses the JupyterLab contents manager, not browser downloads
  • Configurable output format:
    • percent: # %% cell markers
    • script: plain Python with cell comments
  • Configurable overwrite behavior

Install

From PyPI:

pip install jupyterlab-save-py

From this repository:

uv sync
uv pip install -e .

Then start JupyterLab:

jupyter lab

Settings

Open JupyterLab's settings editor and search for Save .py.

Default settings:

{
  "format": "percent",
  "overwrite": true
}

When overwrite is false, existing files are not replaced. The extension will save to name-1.py, name-2.py, and so on.

Development

Install dependencies into .venv with uv:

uv sync
uv run jlpm install
uv run jlpm build
uv pip install -e .

Run JupyterLab:

uv run jupyter lab

Watch TypeScript and labextension builds during development:

uv run jlpm watch

Build

Build frontend assets and Python distributions:

uv run jlpm install
uv run jlpm build:prod
uv run python -m build

The distributions are written to dist/.

Publish

This repository is configured for PyPI Trusted Publishing from GitHub Releases. Configure the PyPI project with:

  • Owner: MihneaTeodorStoica
  • Repository: jupyterlab-save-py
  • Workflow: publish.yml
  • Environment: pypi

Manual upload is also possible:

uv run python -m twine upload dist/*

See CONTRIBUTING.md for the release checklist.

License

MIT

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

jupyterlab_save_py-0.1.2.tar.gz (251.4 kB view details)

Uploaded Source

Built Distribution

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

jupyterlab_save_py-0.1.2-py3-none-any.whl (16.7 kB view details)

Uploaded Python 3

File details

Details for the file jupyterlab_save_py-0.1.2.tar.gz.

File metadata

  • Download URL: jupyterlab_save_py-0.1.2.tar.gz
  • Upload date:
  • Size: 251.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for jupyterlab_save_py-0.1.2.tar.gz
Algorithm Hash digest
SHA256 9eabfc29a3cc85493ad0a2cd61d9cb709478e107dc59f7a9c3ef9bc19d4b64ea
MD5 4e6a2c9ee16841a1e42d16b5c8188483
BLAKE2b-256 573caa38418efb58dbd14ef06fcd30f35d84e5d7cde3c3451e4cec958d0a68f5

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyterlab_save_py-0.1.2.tar.gz:

Publisher: publish.yml on MihneaTeodorStoica/jupyterlab-save-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file jupyterlab_save_py-0.1.2-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_save_py-0.1.2-py3-none-any.whl
Algorithm Hash digest
SHA256 0f824db8aafe3555219c46d961da82a5450b3458d6471d3c8f8ef4b33e6af21a
MD5 fe3b87050c36d47a933ff3a35037f739
BLAKE2b-256 8d748886b5badb4da28f1bef041f5b839481e39092de8064f40fd16c08ec9790

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyterlab_save_py-0.1.2-py3-none-any.whl:

Publisher: publish.yml on MihneaTeodorStoica/jupyterlab-save-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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