A python library simplifying development of ipyvuetify voila apps
Project description
vvapp
A python library simplifying ipyvuetify voila application building.
Install
pip install vvapp
Inputs
vvapp
is meant to be used in Jupyter, so launching jupyter first ($jupyter notebook
).
There are a few key things to keep in mind when getting up and running with vvapp
:
v_model
- The value of
vvapp
inputs is set and accessed via thev_model
attribute, following theipyvuetify
convention
- The value of
class_
- This is where you put
vuetify.js
class properties, likema-4
to add margins around the input
- This is where you put
style_
- This is where you can add CSS to your elements
hint
- The
hint
can be a string or a callable to provide input validation - If
hint
is a callable, it must return a string or None; if it returns a string, the input is marked as invalid and the string is displayed
- The
from vvapp.inputs import __all__ as available_input_widgets
available_input_widgets
['password']
password
from vvapp.inputs import password
pw = password(label='Please enter a password',v_model='correcthorsebatterystapler')
pw
The value of of a vvapp widget is set/accessed by the v_model
attribute, just like in ipyvuetify
pw.v_model
'correcthorsebatterystapler'
import re
def validate_pw(widget_value):
if widget_value is None:
return 'Input must not be None'
else:
if len(widget_value) < 12:
return 'Too Short!'
if len(widget_value) > 64:
return 'Too Long!'
if not re.match('[0-9]+',widget_value):
return 'Must contain at least one number!'
return None
pw = password(label='Please enter a password',v_model='correcthorsebatterystapler', hint=validate_pw)
pw
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
vvapp-0.0.1.tar.gz
(10.2 kB
view hashes)
Built Distribution
vvapp-0.0.1-py3-none-any.whl
(8.0 kB
view hashes)