nbappinator 0.0.4__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,13 @@
1
+ Metadata-Version: 2.1
2
+ Name: nbappinator
3
+ Version: 0.0.4
4
+ Summary: Jupyter Notebook Application Builder
5
+ Author: Your Name
6
+ Author-email: Paul Timmins <paul@iqmo.com>
7
+ Description-Content-Type: text/markdown
8
+ Requires-Dist: ipywidgets~=7.8.0
9
+ Requires-Dist: plotly
10
+ Requires-Dist: ipyvuetify>=1.9
11
+ Requires-Dist: ipyaggrid>=0.5.4
12
+ Requires-Dist: ipytree
13
+ Requires-Dist: pandas>=1.5.3
@@ -0,0 +1,3 @@
1
+ from .appinator import TabbedUiModel, UiModel, UiPage # type: ignore
2
+
3
+ __all__ = ["TabbedUiModel", "UiModel", "UiPage"]
@@ -0,0 +1,38 @@
1
+ import ipyaggrid as ag
2
+ import pandas as pd
3
+ from .datagrid import ColMd, DataGrid
4
+ from typing import Optional, Callable
5
+
6
+
7
+ def display_ag(
8
+ input_df: pd.DataFrame,
9
+ is_tree: bool,
10
+ pathcol: Optional[str] = "path",
11
+ pathdelim="/",
12
+ col_md: list[ColMd] = [], # noqa: F821
13
+ showindex: bool = False,
14
+ action: Optional[Callable] = None,
15
+ num_toppinned_rows: int = 0,
16
+ grid_options: dict = {},
17
+ flatten_columns: bool = True,
18
+ default_precision: int = 2,
19
+ ) -> ag.Grid:
20
+
21
+ grid = DataGrid(
22
+ grid_data=input_df,
23
+ is_tree=is_tree,
24
+ pathcol=pathcol,
25
+ pathdelim=pathdelim,
26
+ col_md=col_md,
27
+ showindex=showindex,
28
+ num_toppinned_rows=num_toppinned_rows,
29
+ grid_options=grid_options,
30
+ default_precision=default_precision,
31
+ flatten_columns=flatten_columns,
32
+ )
33
+
34
+ if action is not None:
35
+ grid.on("cellClicked", action)
36
+
37
+ grid.df = input_df # type: ignore
38
+ return grid