Skip to main content

ipyselect2

Usage

from ipyselect2 import Select2
import ipywidgets as widgets

s1 = Select2(options=['a', 'b'], width='200px')
s2 = Select2(options=['x', 'y'], width='200px', multiple='multiple', lazy=True)
s2.layout.height = '60px'
def values_change(change):
  with output:
    print(change)
s1.observe(values_change, 'value')
s2.observe(values_change, 'values')
output = widgets.Output()
tab = widgets.Tab()
tab.children = [s1, s2]
def tab_change(x):
  if x['new']: s2.lazy = False
tab.observe(tab_change, 'selected_index')
tab.set_title(0, 'single select')
tab.set_title(1, 'multiple select')
display(tab, output)

Installation

A jupyter widget using select2

With pip:

pip install ipyselect2

To make it work for Jupyter lab:

jupyter labextension install @jupyter-widgets/jupyterlab-manager
jupyter labextension install ipyselect2

If you have notebook 5.2 or below, you also need to execute:

jupyter nbextension enable --py --sys-prefix ipyselect2

For a development installation (requires npm),

cd /opt
git clone https://github.com/opentradesolutions/ipyselect2.git
cd ipyselect2
pip install -e .
jupyter nbextension install --py --symlink --sys-prefix ipyselect2
jupyter nbextension enable --py --sys-prefix ipyselect2
jupyter labextension link js

For Jupyter lab development, you may want to start Jupyter lab with jupyter lab –watch so it instantly picks up changes.

Metadata

Release files for ipyselect2 0.2.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for ipyselect2 0.2.1
File Size Uploaded
ipyselect2-0.2.1.tar.gz 444.3 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for ipyselect2 0.2.1
File Interpreter ABI Platform
ipyselect2-0.2.1-py2.py3-none-any.whl Python 3, Python 2 none any Details

Total release size: 1.3 MB

Release files / ipyselect2-0.2.1.tar.gz

Download URL ipyselect2-0.2.1.tar.gz
Size 444.3 kB
Tags Source
SHA-256 checksum
How to use checksums
b3bf6567059972b5e95955c68dfffe7dcd26979e9852eccfd822abcee2dc32e9
BLAKE2b-256 checksum
How to use checksums
c559d47ecc69d578efbad4e0a3302e302677cc5988650e7b81d42e28e8d6e689
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.46.0 CPython/3.6.9

Release files / ipyselect2-0.2.1-py2.py3-none-any.whl

Download URL ipyselect2-0.2.1-py2.py3-none-any.whl
Size 892.4 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
dc439211f78e794baedb26f45a94c19091cada99371d9c8c3ece8cc02017b018
BLAKE2b-256 checksum
How to use checksums
5116ed2c338c0448b1b36e067b733326a914a22f2a0d2ae5252cdb175e2afda8
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/3.1.1 pkginfo/1.5.0.1 requests/2.23.0 setuptools/39.0.1 requests-toolbelt/0.8.0 tqdm/4.46.0 CPython/3.6.9

Release history Release notifications | RSS feed

This release

0.2.1 This release

2 release files

0.2.0

2 release files

0.1.7

2 release files

0.1.6

2 release files

0.1.5

2 release files

0.1.4

2 release files

0.1.3

2 release files

0.1.2

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page