Skip to main content

A JupyterLab extension that passes the relative path of the current notebook to the kernel to allow for notebook automation.

Project description

nbname

Github Actions Status

A JupyterLab extension that passes the relative path of the current notebook to the kernel to allow for notebook automation.

Requirements

  • JupyterLab >= 4.0.0

Install

To install the extension, execute:

uv pip install git+https://github.com/StructuralPython/nbname.git

Uninstall

To remove the extension, execute:

uv pip uninstall nbname

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 nbname directory

# Set up a virtual environment and install package in development mode
uv venv --seed
source .venv/bin/activate
uv sync

# Link your development version of the extension with JupyterLab
jupyter labextension develop . --overwrite

# Rebuild extension Typescript source after making changes
# IMPORTANT: Unlike the steps above which are performed only once, do this step
# every time you make a change.
uv run 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
uv run jlpm watch
# Run JupyterLab in another terminal
uv run 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 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

Development uninstall

pip uninstall nbname

In development mode, you will also need to remove the symlink created by jupyter labextension develop command. To find its location, you can run jupyter labextension list to figure out where the labextensions folder is located. Then you can remove the symlink named nbname within that folder.

Packaging the extension

See RELEASE

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

nbname-0.1.0.tar.gz (188.6 kB view details)

Uploaded Source

Built Distribution

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

nbname-0.1.0-py3-none-any.whl (24.1 kB view details)

Uploaded Python 3

File details

Details for the file nbname-0.1.0.tar.gz.

File metadata

  • Download URL: nbname-0.1.0.tar.gz
  • Upload date:
  • Size: 188.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nbname-0.1.0.tar.gz
Algorithm Hash digest
SHA256 58fe13c0340d09758b6f21db7b35af7f33059578c5b6e1045eb917d325ef48cc
MD5 170e1ee68c2adbe28311bab2f320dd90
BLAKE2b-256 cc0d571d0e5fba09c22d69b2cab43c2b925eced9a5c957646b63039dbc19438c

See more details on using hashes here.

File details

Details for the file nbname-0.1.0-py3-none-any.whl.

File metadata

  • Download URL: nbname-0.1.0-py3-none-any.whl
  • Upload date:
  • Size: 24.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.14 {"installer":{"name":"uv","version":"0.9.14","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Pop!_OS","version":"22.04","id":"jammy","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for nbname-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 ddb5f980c6d4fe6719021290f32eaa628f9aa4c10273c6a44678ca32a4c27868
MD5 c586fca47a10213799642e28df020fc7
BLAKE2b-256 9db30634a65befbee5c824e2c3a5913bc0ca43cb9612969757a46ff7833f9131

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