Skip to main content

Jupyterlab extension to autosave files on focus change

Project description

Jupyterlab Autosave on Focus Change

PyPi Version Supported Python Versions Github Actions Status Binder Docs

All Contributors

A Jupyterlab extension to autosave files on focus change.


Who doesn't know this scenario, you changed some code or input file and the changes don't apply because (again!) you forgot to save the file.

This is where editor settings to save files when the tab (or the whole editor) loose focus come in super handy.

This extension aims to do the same for jupyterlab as the following setting in VS-Code.

  "files.autoSave": "onFocusChange",

Features

  • Autosave on focus change
  • De-/Activation via Settings Menu
  • File exclusion with glob patterns

Requirements

  • JupyterLab >= 4.0

Install

pip install jupyterlab-autosave-on-focus-change

Contributing

Development install

Note: You will need NodeJS to build the extension package.

The jlpm command is JupyterLab's pinned version of yarn that is installed with JupyterLab. You may use yarn or npm in lieu of jlpm below.

# Clone the repo to your local environment
# Change directory to the jupyterlab_autosave_on_focus_change directory
# Install package in development mode
pip install -e .
# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite
# Rebuild extension Typescript source after making changes
jlpm run build

You can watch the source directory and run JupyterLab at the same time in different terminals to watch for changes in the extension's source and automatically rebuild the extension.

# Watch the source directory in one terminal, automatically rebuilding when needed
jlpm run watch
# Run JupyterLab in another terminal
jupyter lab

With the watch command running, every saved change will immediately be built locally and available in your running JupyterLab. Refresh JupyterLab to load the change in your browser (you may need to wait several seconds for the extension to be rebuilt).

By default, the jlpm run build command generates the source maps for this extension to make it easier to debug using the browser dev tools. To also generate source maps for the JupyterLab core extensions, you can run the following command:

jupyter lab build --minimize=False

Uninstall

pip uninstall jupyterlab-autosave-on-focus-change

Contributors ✨

Thanks goes to these wonderful people (emoji key):

Sebastian Weigand
Sebastian Weigand

💻 🤔 🚧 📆 🚇 ⚠️ 📖
mengyanw
mengyanw

💻 🚧
Jakub Klinkovský
Jakub Klinkovský

🐛

This project follows the all-contributors specification. Contributions of any kind welcome!

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

Built Distribution

File details

Details for the file jupyterlab_autosave_on_focus_change-0.4.1.tar.gz.

File metadata

File hashes

Hashes for jupyterlab_autosave_on_focus_change-0.4.1.tar.gz
Algorithm Hash digest
SHA256 54bbec282cfe56f50566e7ed7caf51c98db7280695da97efc089b981622964c9
MD5 4d7fd86f6cb6c22142c3f1cd0af1e79f
BLAKE2b-256 d545bebcee2b144da3b5243a38cbf64f581ec7b855054375928947d943de6fb9

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyterlab_autosave_on_focus_change-0.4.1.tar.gz:

Publisher: build.yml on s-weigand/jupyterlab_autosave_on_focus_change

Attestations:

File details

Details for the file jupyterlab_autosave_on_focus_change-0.4.1-py3-none-any.whl.

File metadata

File hashes

Hashes for jupyterlab_autosave_on_focus_change-0.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 038aefc5d0793852b400f6d967362c379497fe8a40ef640ce3cf294ed9670cba
MD5 91302f73d3026ddbe8e495a0533a9814
BLAKE2b-256 f0ffb5e6973201724534e6976f8159a3c2437a928bc9c243be6b6e5a0035c0d9

See more details on using hashes here.

Provenance

The following attestation bundles were made for jupyterlab_autosave_on_focus_change-0.4.1-py3-none-any.whl:

Publisher: build.yml on s-weigand/jupyterlab_autosave_on_focus_change

Attestations:

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page