CtrlK
BlogDocsLog inGet started
Tessl Logo

tessl/pypi-jupyterlab-visualpython

GUI-based Python code generator extension for Jupyter Lab, Jupyter Notebook, and Google Colab

Pending
Overview
Eval results
Files

python-module.mddocs/

Python Module

Core Python module interface for jupyterlab-visualpython, providing extension discovery and version management for JupyterLab integration.

Capabilities

Extension Discovery

Provides JupyterLab with extension path information for proper installation and loading.

def _jupyter_labextension_paths() -> List[Dict[str, str]];

Description: Returns a list containing extension path configuration for JupyterLab extension discovery. Called automatically by JupyterLab during extension loading process.

Returns:

  • List[Dict[str, str]]: List with single dictionary containing:
    • 'src': Source path to extension assets
    • 'dest': Destination identifier for extension

Usage Example:

import visualpython

# Called automatically by JupyterLab
paths = visualpython._jupyter_labextension_paths()
# Returns: [{'src': 'labextension', 'dest': 'jupyterlab-visualpython'}]

Version Information

Module version identifier following semantic versioning.

__version__: str

Description: String constant containing the current version of the visualpython module.

Value: "0.1.0"

Usage Example:

import visualpython

print(f"Visual Python version: {visualpython.__version__}")
# Output: Visual Python version: 0.1.0

Module Structure

Import Behavior

The module attempts to import version information from _version.py and falls back to "dev" if unavailable:

try:
    from ._version import __version__
except ImportError:
    import warnings
    warnings.warn("Could not determine version", UserWarning)
    __version__ = "dev"

Module Files

  • __init__.py: Main module file with public API
  • _version.py: Version definition file

Installation Integration

The module integrates with pip and JupyterLab through:

  1. Pip Installation: Package installed via pip install jupyterlab-visualpython
  2. Extension Discovery: JupyterLab calls _jupyter_labextension_paths() to locate extension
  3. Asset Loading: Extension assets loaded from specified paths
  4. UI Integration: Visual Python interface becomes available in JupyterLab

Error Handling

The module handles version import failures gracefully by:

  • Catching ImportError when _version.py is unavailable
  • Issuing a warning about version determination failure
  • Falling back to "dev" version identifier
  • Continuing normal operation despite version import issues

Install with Tessl CLI

npx tessl i tessl/pypi-jupyterlab-visualpython

docs

commands.md

extension.md

index.md

panel.md

python-module.md

tile.json