Registry / jupyter-contrib-core

jupyter-contrib-core

JSON →
library0.4.2pypypiunverified

Jupyter Contrib Core provides common utilities for jupyter-contrib projects, primarily offering a `notebook-4.2`-compatible `nbextension` API to smooth over differences across various Jupyter Notebook versions. It includes shared application components, CLI scripts, and testing utilities for developers building Jupyter extensions. The current version is 0.4.2, and releases are generally driven by compatibility updates with newer Jupyter Notebook versions.

pip install jupyter-contrib-core
INSTALL
IMPORT
SIG · JUPYTER-CONTRIB-CO
J
jupyter-contrib-core
pythonv0.4.2
Install
16.2s avg
Import
Disk
271MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.4.2 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.920 runs
installs and imports cleanly · install 0.0s · import 0.000s · 279.1MB
glibc
py 3.103.920 runs
installs and imports cleanly · install 16.2s · import 0.000s · 263MB
271MB installed
● package 271MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

enable_nbextension_python
from jupyter_contrib_core import enable_nbextension_python
from jupyter_contrib_core import enable_nbextension_python

This quickstart demonstrates how to programmatically enable and disable a hypothetical Python nbextension using the compatibility functions provided by `jupyter-contrib-core`. This is typically used by other `jupyter-contrib` projects or advanced setup scripts, rather than directly by end-users. The functions interact with Jupyter's configuration.

import logging from jupyter_contrib_core.notebook_compat.nbextensions import enable_nbextension_python, disable_nbextension_python # jupyter-contrib-core is primarily for developers building Jupyter extensions. # This example demonstrates programmatic enabling/disabling of a hypothetical # Python-based nbextension using its compatibility API. # Set up a basic logger as it's a required argument for these functions. log = logging.getLogger(__name__) log.setLevel(logging.INFO) handler = logging.StreamHandler() formatter = logging.Formatter('%(levelname)s: %(message)s') handler.setFormatter(formatter) log.addHandler(handler) dummy_extension_name = "my_dummy_jupyter_extension" try: print(f"\nAttempting to enable nbextension: {dummy_extension_name}") # Note: This will update Jupyter's configuration, but won't # physically install files. If the extension isn't present, # it might still 'enable' it in config, but it won't load. enable_nbextension_python( dummy_extension_name, user=True, # Apply for the current user sys_prefix=False, overwrite=False, logger=log ) print(f"Successfully (or attempted) to enable {dummy_extension_name}. Check your Jupyter config.") print(f"\nAttempting to disable nbextension: {dummy_extension_name}") disable_nbextension_python( dummy_extension_name, user=True, logger=log ) print(f"Successfully (or attempted) to disable {dummy_extension_name}.") except Exception as e: print(f"\nAn error occurred during nbextension management: {e}")
jupyter-contrib-core --version
Debug
Known issues
breakingVersions of `jupyter-contrib-core` prior to 0.3.2 may not be compatible with Jupyter Notebook 5.0 and later due to internal module structure changes in `notebook` (e.g., `ArgumentConflict` module moved).
fix
Upgrade `jupyter-contrib-core` to version 0.3.2 or later when using Jupyter Notebook 5.0+.
affects: <0.3.2
gotcha`jupyter-contrib-core` aims to smooth over differences in the `nbextension` API across various Jupyter Notebook versions. Directly interacting with Jupyter Notebook's internal `nbextensions` APIs, rather than using the shims provided by this library, can lead to unexpected behavior or breakage when upgrading `notebook` versions.
fix
Always use the compatibility layer provided by `jupyter_contrib_core.notebook_compat` when developing or managing `jupyter-contrib` extensions to ensure broader compatibility.
affects: All versions
breakingSignificant changes in Jupyter's architecture (e.g., moving from `notebook` to `jupyter_server` for modern JupyterLab deployments) may introduce incompatibilities. While `jupyter-contrib-core` provides `notebook` compatibility, its direct utility for `jupyter_server`-based environments might be limited or require newer, dedicated compatibility layers.
fix
Carefully review `jupyter-contrib-core` and dependent extension documentation when upgrading your Jupyter backend from `notebook` to `jupyter_server`. Some `nbextension`-style management may not directly translate.
affects: All versions (when transitioning from `notebook` to `jupyter_server`)
Upgrade
Version history
0.4.2latest on PyPI · released Nov 15, 2022
Audit
Dependencies
notebookrequiredProvides compatibility shims for Jupyter Notebook's nbextension API, requiring a Jupyter Notebook installation to be functional.
Agent activity
12 hits · last 30 days
node
12
Resources
jupyter-contrib-core — pip install jupyter-contrib-core · libregistry