0
# Visual Python for JupyterLab
1
2
Visual Python is a GUI-based Python code generator extension for JupyterLab that enables users to create Python code through an intuitive visual interface. It provides a comprehensive visual programming environment within JupyterLab, making data science and Python programming accessible to users with minimal coding experience.
3
4
## Package Information
5
6
- **Package Name**: jupyterlab-visualpython
7
- **Package Type**: pypi
8
- **Language**: Python/TypeScript
9
- **Installation**: `pip install jupyterlab-visualpython`
10
- **JupyterLab Version**: 4.x
11
- **Python Version**: 3.8 - 3.11
12
13
## Core Imports
14
15
The package provides both Python module imports and JupyterLab extension functionality:
16
17
```python
18
# Python module import (for extension discovery)
19
import visualpython
20
```
21
22
```javascript
23
// JupyterLab extension is automatically loaded
24
// Commands and UI components are registered automatically
25
```
26
27
## Basic Usage
28
29
After installation, Visual Python integrates directly into JupyterLab:
30
31
```bash
32
# Install the extension
33
pip install jupyterlab-visualpython
34
35
# Start JupyterLab (Visual Python will be available)
36
jupyter lab
37
```
38
39
Visual Python provides:
40
- GUI-based Python code generation
41
- Visual programming interface in JupyterLab sidebar
42
- Drag-and-drop code creation
43
- Code snippet saving and reuse
44
- Integration with Jupyter notebooks
45
46
## Architecture
47
48
Visual Python consists of several key components:
49
50
- **Python Module**: Provides extension metadata and discovery for JupyterLab
51
- **JupyterLab Extension**: Frontend TypeScript/JavaScript extension for UI integration
52
- **Visual Panel**: Main GUI component for visual programming
53
- **Command System**: Integration with JupyterLab's command palette and shortcuts
54
- **Configuration Schema**: Settings and toolbar integration
55
56
## Capabilities
57
58
### Python Module Interface
59
60
Core Python module providing JupyterLab extension discovery and version information.
61
62
```python { .api }
63
# Module-level functions
64
def _jupyter_labextension_paths() -> List[Dict[str, str]];
65
66
# Module variables
67
__version__: str
68
```
69
70
[Python Module](./python-module.md)
71
72
### JupyterLab Extension
73
74
Main extension plugin that integrates Visual Python into JupyterLab interface with panel management and command registration.
75
76
```javascript { .api }
77
// Extension activation
78
function activate(app: JupyterLab, palette: ICommandPalette): void;
79
80
// Global variables set by extension
81
global.vpBase: string;
82
global.vpExtType: string;
83
global.vpLab: JupyterLab;
84
global.$: jQuery;
85
```
86
87
[JupyterLab Extension](./extension.md)
88
89
### Visual Python Panel
90
91
Interactive panel component providing the main Visual Python GUI interface within JupyterLab.
92
93
```javascript { .api }
94
class VpPanel extends Panel {
95
constructor(app: JupyterLab);
96
onResize(msg: ResizeMessage): void;
97
onBeforeShow(): void;
98
onAfterHide(): void;
99
onAfterAttach(): void;
100
onCloseRequest(msg: CloseRequestMessage): void;
101
}
102
```
103
104
[Visual Python Panel](./panel.md)
105
106
### Commands and Shortcuts
107
108
Command system integration providing keyboard shortcuts and menu access to Visual Python functionality.
109
110
```javascript { .api }
111
// Available commands
112
'jupyterlab-visualpython:toggle': Command;
113
114
// Keyboard shortcuts
115
'Accel Shift V': 'jupyterlab-visualpython:toggle'; // Toggle Visual Python panel
116
```
117
118
[Commands and Shortcuts](./commands.md)
119
120
## Types
121
122
```python { .api }
123
# Python types
124
Dict = dict
125
List = list
126
```
127
128
```typescript { .api }
129
// JupyterLab types
130
interface JupyterLab extends JupyterFrontEnd {
131
shell: ILabShell;
132
commands: CommandRegistry;
133
version: string;
134
}
135
136
interface ICommandPalette {
137
addItem(options: IPaletteItem): IDisposable;
138
}
139
140
interface Panel extends Widget {
141
id: string;
142
title: Title<Widget>;
143
isVisible: boolean;
144
}
145
146
type ResizeMessage = Message;
147
type CloseRequestMessage = Message;
148
type Message = any; // Lumino message base type
149
```