The powerful data exploration & web app framework for Python.
npx @tessl/cli install tessl/pypi-panel@1.7.00
# Panel
1
2
A comprehensive Python web application framework that enables building powerful interactive web applications, dashboards, and data exploration tools entirely in Python. Panel provides both high-level reactive APIs and lower-level callback-based APIs, making it suitable for both quick exploratory applications and complex multi-page applications with rich interactivity.
3
4
## Package Information
5
6
- **Package Name**: panel
7
- **Language**: Python
8
- **Installation**: `pip install panel`
9
10
## Core Imports
11
12
```python
13
import panel as pn
14
```
15
16
For extension configuration:
17
```python
18
pn.extension() # Basic setup
19
pn.extension('tabulator', 'bokeh') # With specific extensions
20
```
21
22
## Basic Usage
23
24
```python
25
import panel as pn
26
27
# Enable Panel extensions
28
pn.extension()
29
30
# Create basic components
31
text_input = pn.widgets.TextInput(value="Hello Panel", placeholder="Enter text")
32
button = pn.widgets.Button(name="Click me", button_type="primary")
33
34
# Create layout
35
layout = pn.Column(
36
"# My Panel App",
37
text_input,
38
button,
39
pn.pane.Markdown("Welcome to Panel!")
40
)
41
42
# Serve the app
43
layout.servable()
44
pn.serve(layout, port=5007, show=True)
45
```
46
47
## Architecture
48
49
Panel's architecture is built around several key concepts:
50
51
- **Viewables**: Base objects that can be displayed (Pane, Widget, Layout, Template)
52
- **Panes**: Display components for various content types (HTML, images, plots, etc.)
53
- **Widgets**: Interactive input components (buttons, sliders, text inputs, etc.)
54
- **Layouts**: Container components for organizing other components (Row, Column, Tabs, etc.)
55
- **Templates**: Professional application templates for structured layouts
56
- **Reactive System**: Parameter-based reactivity with `bind`, `depends`, and `Param` integration
57
58
This design seamlessly integrates with the PyData ecosystem and popular visualization libraries including Altair, Bokeh, Matplotlib, Plotly, HoloViews, and many others.
59
60
## Capabilities
61
62
### Core Functions
63
64
Essential functions for configuration, serving, binding, and converting objects to Panel components.
65
66
```python { .api }
67
def panel(obj, **params):
68
"""Convert Python objects to Panel components automatically"""
69
70
def serve(panels, **kwargs):
71
"""Serve Panel applications on web server"""
72
73
def extension(*args, **kwargs):
74
"""Configure Panel extensions and settings"""
75
76
def bind(function, *args, **kwargs):
77
"""Bind function parameters for reactive programming"""
78
79
def depends(*parameters):
80
"""Declare parameter dependencies for functions"""
81
```
82
83
[Core Functions](./core-functions.md)
84
85
### Layout Components
86
87
Container components for organizing and structuring Panel applications, from basic row/column layouts to advanced grid systems and modal dialogs.
88
89
```python { .api }
90
class Column:
91
"""Vertical layout container"""
92
93
class Row:
94
"""Horizontal layout container"""
95
96
class Tabs:
97
"""Tabbed interface layout"""
98
99
class Card:
100
"""Card-style container with header/body"""
101
102
class GridSpec:
103
"""Matplotlib-style grid specification"""
104
```
105
106
[Layout Components](./layout-components.md)
107
108
### Widget System
109
110
Comprehensive collection of interactive input components including text inputs, selections, sliders, buttons, tables, and specialized widgets for various data types.
111
112
```python { .api }
113
class TextInput:
114
"""Single-line text input widget"""
115
116
class Select:
117
"""Dropdown selection widget"""
118
119
class IntSlider:
120
"""Integer slider widget"""
121
122
class Button:
123
"""Click button widget"""
124
125
class Tabulator:
126
"""Interactive data table widget"""
127
```
128
129
[Widget System](./widget-system.md)
130
131
### Pane System
132
133
Display components that render various content types including text, images, plots, and integration with popular visualization libraries.
134
135
```python { .api }
136
class HTML:
137
"""HTML content pane"""
138
139
class Markdown:
140
"""Markdown content pane"""
141
142
class Bokeh:
143
"""Bokeh plot pane"""
144
145
class Matplotlib:
146
"""Matplotlib figure pane"""
147
148
class Plotly:
149
"""Plotly figure pane"""
150
```
151
152
[Pane System](./pane-system.md)
153
154
### Template System
155
156
Professional application templates providing structured layouts and theming for building production-ready web applications.
157
158
```python { .api }
159
class BootstrapTemplate:
160
"""Bootstrap-based template"""
161
162
class MaterialTemplate:
163
"""Material Design template"""
164
165
class FastGridTemplate:
166
"""Fast loading grid template"""
167
```
168
169
[Template System](./template-system.md)
170
171
### Chat Interface
172
173
Complete chat interface system for building conversational applications with message feeds, input areas, and reaction components.
174
175
```python { .api }
176
class ChatInterface:
177
"""Complete chat interface component"""
178
179
class ChatFeed:
180
"""Message feed component"""
181
182
class ChatMessage:
183
"""Individual chat message"""
184
```
185
186
[Chat Interface](./chat-interface.md)
187
188
### Custom Components
189
190
Classes for extending Panel with custom functionality using Python, JavaScript, React, or ESM modules.
191
192
```python { .api }
193
class PyComponent:
194
"""Python-based custom component"""
195
196
class JSComponent:
197
"""JavaScript-based component"""
198
199
class ReactComponent:
200
"""React-based component"""
201
```
202
203
[Custom Components](./custom-components.md)
204
205
### Parameter Integration
206
207
Integration with the Param library for creating reactive UIs from parameterized classes and managing parameter dependencies.
208
209
```python { .api }
210
class Param:
211
"""Auto-generate UI from Parameterized class"""
212
213
class ReactiveExpr:
214
"""Reactive expression component"""
215
```
216
217
[Parameter Integration](./parameter-integration.md)
218
219
### Authentication System
220
221
Complete authentication and authorization system supporting OAuth providers, basic authentication, and custom login handlers for securing enterprise applications.
222
223
```python { .api }
224
class GoogleLoginHandler:
225
"""Google OAuth login handler"""
226
227
class BasicAuthProvider:
228
"""Base authentication provider for Panel applications"""
229
230
class OAuthProvider:
231
"""OAuth-based authentication provider"""
232
233
class BasicLoginHandler:
234
"""Basic username/password login handler"""
235
```
236
237
[Authentication System](./authentication-system.md)
238
239
### Links System
240
241
Advanced reactive programming system for creating property links between Panel components, enabling sophisticated reactive patterns and cross-component synchronization.
242
243
```python { .api }
244
class Link:
245
"""Base class for linking properties between components"""
246
247
class Callback:
248
"""Base callback class for reactive programming patterns"""
249
250
class JSCallbackGenerator:
251
"""Generates JavaScript callbacks for client-side property linking"""
252
```
253
254
[Links System](./links-system.md)
255
256
### Pipeline System
257
258
Workflow pipeline system for building multi-step interactive applications with directed graph navigation, supporting complex workflows and guided user experiences.
259
260
```python { .api }
261
class Pipeline:
262
"""Directed graph of workflow stages for building multi-step applications"""
263
264
class PipelineError:
265
"""Custom error type for pipeline-specific error messages"""
266
```
267
268
[Pipeline System](./pipeline-system.md)
269
270
## Global Objects
271
272
```python { .api }
273
config: Config
274
"""Global Panel configuration object for themes, templates, sizing modes, and behavioral settings"""
275
276
state: State
277
"""Global application state manager for server-side state, caching, and periodic callbacks"""
278
279
rx: Module
280
"""Reactive expressions module from param library for advanced reactive programming"""
281
282
cache: Function
283
"""Caching decorator for function results to improve performance"""
284
285
indicators: Module
286
"""Indicator widgets module for progress bars, spinners, and status displays"""
287
288
interact: Function
289
"""Create interactive UI components from function parameters automatically"""
290
291
__version__: str
292
"""Panel version number string"""
293
```