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

💻 🚧

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

jupyterlab_autosave_on_focus_change-0.4.0.tar.gz (4.2 MB view details)

Uploaded Source

Built Distribution

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

File details

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

File metadata

File hashes

Hashes for jupyterlab_autosave_on_focus_change-0.4.0.tar.gz
Algorithm Hash digest
SHA256 549de0256fbd3c02dd6e6454960e44e5cb710ee50378f13ad0fae74eaec8d94b
MD5 b130ea0cc154eecc5658a63a023762af
BLAKE2b-256 763852f66677aca3a02949ec77f4479480a166eec3e87c4fb2f8284cc4ad9f28

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for jupyterlab_autosave_on_focus_change-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 58bc7a63d6cbd4329562f9b8d0b9a654fc43bd40901fe68af1a11e6072bd36ec
MD5 8bb0e5c33961ff9790b5b7dd23017c62
BLAKE2b-256 7a9e1dda9aba382daf7b1e4061887f7d142de33fac223c31d2f6272fa68dea25

See more details on using hashes here.

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