Helper library from Curvenote for data science in Jupyter notebooks
Project description
curvenote
The Curvenote helper library for working in Jupyter Notebooks with Python kernels
## Installation
~$ python -m pip install curvenote
Summary
-
stash
save a dict or pandas dataframe in a cell output without diaplying the datafrom curvenote import stash stash('myvars', myvars)
-
AppState
a traitlet based class to help manage state in ipywidgets ui'sfrom curvenote import AppState, with_state state = AppState() # register a widget in state wave_1_amp = FloatSlider(1.0, min=0.1, max=5.0, step=0.1, description="1 - Amp") state.register_stateful_widget(wave_1_amp, "wave_1_amp", Float(1.0)) # register any trailet as a propery state.register_stateful_property("my_dict", Dict(dict(A="hello", B="world", C=1))) # observe the entire state def my_update_fn(state): some_calc_function(state.wave_1_amp, state.my_dict) state.observe(with_state(my_update_fn)) # observe a single registered widget def wave_1_observer(evt): pass state.register_widget_observer("wave_1_amp", wave_1_observer) # observe a single trait def trait_observer(evt): pass state.register_widget_observer("my_dict", trait_observer) # display state changes for debugging from IPython.display import display display(state.outlet)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
curvenote-0.7.2.tar.gz
(4.0 kB
view hashes)
Built Distribution
Close
Hashes for curvenote-0.7.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9d5d8a51d5afc90a15d77ae7ca9a4185c261f7a92d35271f0e6a177fe4eaac1 |
|
MD5 | 20068a405483be429faadfd0333c6bab |
|
BLAKE2b-256 | e0b5b643003717a9c4fa9ba3536a513e27d8005626cbb6213559a14d534854f4 |