No project description provided
Project description
Short Overview.
ipyvuetify_app is a python package (py>=3.7) with a scaffold/template for writing ipyvuetify application
Installation via pip:
pip install ipyvuetify_app
How to use it
To create an application by the given template you need to create a class
That will be in charge of what to show in the main application section
For every selected menu item -> subitem
Then you just give it to ipyvuetify_app.VueApp and it does all the magic for you
from ipyvuetify_app import VueApp
from ipyvuetify_app import VueAppRouter
vue_app_router = VueAppRouter()
VueApp(
vue_app_router,
list_footer_vw_children=["Footer example"],
)
Examples how your app can look like
Router example
Every router should satisfy 2 conditions:
1) It has method get_main_content(self, item, subitem) which should return page main content
2) It has attribute self.dict_list_subitems_by_item with all subitems for every menu item
class VueAppRouter():
"""Routing for VueApp to emulate transition over pages in the app"""
def __init__(self) -> None:
"""Initialize dictionary with all menus and their subitems"""
self.dict_list_subitems_by_item = {}
for item in range(5):
list_subitems = [str(subitem) for subitem in range(item, 5 + item)]
self.dict_list_subitems_by_item[str(item)] = list_subitems
def get_main_content(self, item, subitem):
"""Router to get main content for clicked submenu element
Args:
item (str): selected menu
subitem (str): submenu element for which to build a page
Returns:
ipyvuetify container or string: page content to show at main section
"""
try:
sleep(int(item))
return f"{item} -> {subitem}"
except Exception as ex:
return self.error_page_content(str(ex))
def error_page_content(self, str_error="Unable to get page content"):
"""Return content of error message to show when something going wrong
Args:
str_error (str, optional): Error message to show
Returns:
[str]: Error message to display
"""
return f"ERROR: {str_error}"
Full VuaApp signature
VueApp(
vue_app_router,
list_vw_fab_app_bar_left=None,
list_vw_fab_app_bar_right=None,
list_footer_vw_children=None,
)
Links
Project local Links
Contacts
License
This project is licensed under the MIT License.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ipyvuetify_app-0.1.2.tar.gz
(6.3 kB
view hashes)
Built Distribution
Close
Hashes for ipyvuetify_app-0.1.2-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 1635bae09e2456fcfebf1018aeb4ab5a29d3cba5d773457f472ee787ac2bfc7e |
|
MD5 | 191ee191a12f3f16fd1b85bfc4aed716 |
|
BLAKE2b-256 | 9c842bbc94ad11bc29fa00c0a5e2f1fde27b8375b0cee6aae1f3ed45fb6f875b |