Skip to content

Commit 099e88f

Browse files
committed
refactor: Move load function to utils module
1 parent 5b1502e commit 099e88f

File tree

6 files changed

+141
-139
lines changed

6 files changed

+141
-139
lines changed

examples/01_getting_started.ipynb

+43-43
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "44486550",
5+
"id": "78f0ac8f",
66
"metadata": {},
77
"source": [
88
"# pandas-render\n",
@@ -26,13 +26,13 @@
2626
{
2727
"cell_type": "code",
2828
"execution_count": 1,
29-
"id": "c2473ea5",
29+
"id": "4eaf4e88",
3030
"metadata": {
3131
"execution": {
32-
"iopub.execute_input": "2025-04-07T21:20:42.126356Z",
33-
"iopub.status.busy": "2025-04-07T21:20:42.125998Z",
34-
"iopub.status.idle": "2025-04-07T21:20:42.352274Z",
35-
"shell.execute_reply": "2025-04-07T21:20:42.351905Z"
32+
"iopub.execute_input": "2025-04-09T20:19:10.369086Z",
33+
"iopub.status.busy": "2025-04-09T20:19:10.368739Z",
34+
"iopub.status.idle": "2025-04-09T20:19:10.601259Z",
35+
"shell.execute_reply": "2025-04-09T20:19:10.600903Z"
3636
}
3737
},
3838
"outputs": [],
@@ -42,7 +42,7 @@
4242
},
4343
{
4444
"cell_type": "markdown",
45-
"id": "b197c4cd",
45+
"id": "a334cc5f",
4646
"metadata": {},
4747
"source": [
4848
"Or import it implicitly after importing pandas:\n",
@@ -55,7 +55,7 @@
5555
},
5656
{
5757
"cell_type": "markdown",
58-
"id": "5d0ea9ce",
58+
"id": "d03ce87d",
5959
"metadata": {},
6060
"source": [
6161
"### Data\n",
@@ -65,13 +65,13 @@
6565
{
6666
"cell_type": "code",
6767
"execution_count": 2,
68-
"id": "a4539d38",
68+
"id": "a6b2aae4",
6969
"metadata": {
7070
"execution": {
71-
"iopub.execute_input": "2025-04-07T21:20:42.354058Z",
72-
"iopub.status.busy": "2025-04-07T21:20:42.353911Z",
73-
"iopub.status.idle": "2025-04-07T21:20:42.357418Z",
74-
"shell.execute_reply": "2025-04-07T21:20:42.357113Z"
71+
"iopub.execute_input": "2025-04-09T20:19:10.603147Z",
72+
"iopub.status.busy": "2025-04-09T20:19:10.602998Z",
73+
"iopub.status.idle": "2025-04-09T20:19:10.606545Z",
74+
"shell.execute_reply": "2025-04-09T20:19:10.606214Z"
7575
}
7676
},
7777
"outputs": [],
@@ -108,7 +108,7 @@
108108
},
109109
{
110110
"cell_type": "markdown",
111-
"id": "1005d460",
111+
"id": "13fd36af",
112112
"metadata": {},
113113
"source": [
114114
"Here is the original rendering of the DataFrame. It's a simple table with no formatting or styling. It's not very readable, and the data is not very visually appealing."
@@ -117,13 +117,13 @@
117117
{
118118
"cell_type": "code",
119119
"execution_count": 3,
120-
"id": "6960dd92",
120+
"id": "b6aff844",
121121
"metadata": {
122122
"execution": {
123-
"iopub.execute_input": "2025-04-07T21:20:42.358723Z",
124-
"iopub.status.busy": "2025-04-07T21:20:42.358630Z",
125-
"iopub.status.idle": "2025-04-07T21:20:42.366012Z",
126-
"shell.execute_reply": "2025-04-07T21:20:42.365747Z"
123+
"iopub.execute_input": "2025-04-09T20:19:10.607989Z",
124+
"iopub.status.busy": "2025-04-09T20:19:10.607898Z",
125+
"iopub.status.idle": "2025-04-09T20:19:10.615814Z",
126+
"shell.execute_reply": "2025-04-09T20:19:10.615568Z"
127127
}
128128
},
129129
"outputs": [
@@ -216,7 +216,7 @@
216216
},
217217
{
218218
"cell_type": "markdown",
219-
"id": "3006be20",
219+
"id": "422c0e7d",
220220
"metadata": {},
221221
"source": [
222222
"### Rendering\n",
@@ -226,13 +226,13 @@
226226
{
227227
"cell_type": "code",
228228
"execution_count": 4,
229-
"id": "e38455bb",
229+
"id": "c5155e59",
230230
"metadata": {
231231
"execution": {
232-
"iopub.execute_input": "2025-04-07T21:20:42.367314Z",
233-
"iopub.status.busy": "2025-04-07T21:20:42.367207Z",
234-
"iopub.status.idle": "2025-04-07T21:20:42.373788Z",
235-
"shell.execute_reply": "2025-04-07T21:20:42.373527Z"
232+
"iopub.execute_input": "2025-04-09T20:19:10.617109Z",
233+
"iopub.status.busy": "2025-04-09T20:19:10.617004Z",
234+
"iopub.status.idle": "2025-04-09T20:19:10.623701Z",
235+
"shell.execute_reply": "2025-04-09T20:19:10.623460Z"
236236
}
237237
},
238238
"outputs": [
@@ -267,7 +267,7 @@
267267
},
268268
{
269269
"cell_type": "markdown",
270-
"id": "58c08bfa",
270+
"id": "26d5975a",
271271
"metadata": {},
272272
"source": [
273273
"### Filtering and Ordering\n",
@@ -277,13 +277,13 @@
277277
{
278278
"cell_type": "code",
279279
"execution_count": 5,
280-
"id": "f8bfe0ab",
280+
"id": "7c860df7",
281281
"metadata": {
282282
"execution": {
283-
"iopub.execute_input": "2025-04-07T21:20:42.375033Z",
284-
"iopub.status.busy": "2025-04-07T21:20:42.374942Z",
285-
"iopub.status.idle": "2025-04-07T21:20:42.379552Z",
286-
"shell.execute_reply": "2025-04-07T21:20:42.379292Z"
283+
"iopub.execute_input": "2025-04-09T20:19:10.624992Z",
284+
"iopub.status.busy": "2025-04-09T20:19:10.624902Z",
285+
"iopub.status.idle": "2025-04-09T20:19:10.629356Z",
286+
"shell.execute_reply": "2025-04-09T20:19:10.629061Z"
287287
},
288288
"lines_to_next_cell": 2
289289
},
@@ -317,7 +317,7 @@
317317
},
318318
{
319319
"cell_type": "markdown",
320-
"id": "46f0665c",
320+
"id": "271560e5",
321321
"metadata": {},
322322
"source": [
323323
"### Dynamic Placeholder\n",
@@ -328,13 +328,13 @@
328328
{
329329
"cell_type": "code",
330330
"execution_count": 6,
331-
"id": "bd10af98",
331+
"id": "bf8511de",
332332
"metadata": {
333333
"execution": {
334-
"iopub.execute_input": "2025-04-07T21:20:42.380928Z",
335-
"iopub.status.busy": "2025-04-07T21:20:42.380839Z",
336-
"iopub.status.idle": "2025-04-07T21:20:42.386596Z",
337-
"shell.execute_reply": "2025-04-07T21:20:42.386348Z"
334+
"iopub.execute_input": "2025-04-09T20:19:10.630710Z",
335+
"iopub.status.busy": "2025-04-09T20:19:10.630619Z",
336+
"iopub.status.idle": "2025-04-09T20:19:10.636359Z",
337+
"shell.execute_reply": "2025-04-09T20:19:10.636068Z"
338338
}
339339
},
340340
"outputs": [
@@ -415,7 +415,7 @@
415415
},
416416
{
417417
"cell_type": "markdown",
418-
"id": "1ab9b9da",
418+
"id": "98b3f75f",
419419
"metadata": {},
420420
"source": [
421421
"### Gallery\n",
@@ -425,13 +425,13 @@
425425
{
426426
"cell_type": "code",
427427
"execution_count": 7,
428-
"id": "881b2962",
428+
"id": "a597d0a5",
429429
"metadata": {
430430
"execution": {
431-
"iopub.execute_input": "2025-04-07T21:20:42.387913Z",
432-
"iopub.status.busy": "2025-04-07T21:20:42.387812Z",
433-
"iopub.status.idle": "2025-04-07T21:20:42.391944Z",
434-
"shell.execute_reply": "2025-04-07T21:20:42.391667Z"
431+
"iopub.execute_input": "2025-04-09T20:19:10.637703Z",
432+
"iopub.status.busy": "2025-04-09T20:19:10.637613Z",
433+
"iopub.status.idle": "2025-04-09T20:19:10.641875Z",
434+
"shell.execute_reply": "2025-04-09T20:19:10.641614Z"
435435
}
436436
},
437437
"outputs": [

examples/02_components.ipynb

+30-30
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"cells": [
33
{
44
"cell_type": "markdown",
5-
"id": "d4286369",
5+
"id": "a9aaa683",
66
"metadata": {},
77
"source": [
88
"# pandas-render\n",
@@ -24,13 +24,13 @@
2424
{
2525
"cell_type": "code",
2626
"execution_count": 1,
27-
"id": "af641ebf",
27+
"id": "b46b7824",
2828
"metadata": {
2929
"execution": {
30-
"iopub.execute_input": "2025-04-07T21:20:39.955510Z",
31-
"iopub.status.busy": "2025-04-07T21:20:39.955130Z",
32-
"iopub.status.idle": "2025-04-07T21:20:40.187949Z",
33-
"shell.execute_reply": "2025-04-07T21:20:40.187597Z"
30+
"iopub.execute_input": "2025-04-09T20:19:08.132988Z",
31+
"iopub.status.busy": "2025-04-09T20:19:08.132626Z",
32+
"iopub.status.idle": "2025-04-09T20:19:08.348788Z",
33+
"shell.execute_reply": "2025-04-09T20:19:08.348426Z"
3434
}
3535
},
3636
"outputs": [],
@@ -40,7 +40,7 @@
4040
},
4141
{
4242
"cell_type": "markdown",
43-
"id": "7a6eb0c3",
43+
"id": "f7e6f6c0",
4444
"metadata": {},
4545
"source": [
4646
"### Data\n",
@@ -50,13 +50,13 @@
5050
{
5151
"cell_type": "code",
5252
"execution_count": 2,
53-
"id": "6a432df6",
53+
"id": "d1c0f01a",
5454
"metadata": {
5555
"execution": {
56-
"iopub.execute_input": "2025-04-07T21:20:40.189752Z",
57-
"iopub.status.busy": "2025-04-07T21:20:40.189609Z",
58-
"iopub.status.idle": "2025-04-07T21:20:40.193383Z",
59-
"shell.execute_reply": "2025-04-07T21:20:40.193090Z"
56+
"iopub.execute_input": "2025-04-09T20:19:08.350496Z",
57+
"iopub.status.busy": "2025-04-09T20:19:08.350381Z",
58+
"iopub.status.idle": "2025-04-09T20:19:08.354255Z",
59+
"shell.execute_reply": "2025-04-09T20:19:08.353885Z"
6060
}
6161
},
6262
"outputs": [],
@@ -93,7 +93,7 @@
9393
},
9494
{
9595
"cell_type": "markdown",
96-
"id": "b51d6cfd",
96+
"id": "34100c94",
9797
"metadata": {},
9898
"source": [
9999
"### Rendering\n",
@@ -103,13 +103,13 @@
103103
{
104104
"cell_type": "code",
105105
"execution_count": 3,
106-
"id": "c95d1efb",
106+
"id": "a1806a7b",
107107
"metadata": {
108108
"execution": {
109-
"iopub.execute_input": "2025-04-07T21:20:40.194685Z",
110-
"iopub.status.busy": "2025-04-07T21:20:40.194598Z",
111-
"iopub.status.idle": "2025-04-07T21:20:40.202859Z",
112-
"shell.execute_reply": "2025-04-07T21:20:40.202556Z"
109+
"iopub.execute_input": "2025-04-09T20:19:08.355639Z",
110+
"iopub.status.busy": "2025-04-09T20:19:08.355551Z",
111+
"iopub.status.idle": "2025-04-09T20:19:08.363832Z",
112+
"shell.execute_reply": "2025-04-09T20:19:08.363527Z"
113113
}
114114
},
115115
"outputs": [
@@ -190,7 +190,7 @@
190190
},
191191
{
192192
"cell_type": "markdown",
193-
"id": "9a091801",
193+
"id": "9a4b4c86",
194194
"metadata": {},
195195
"source": [
196196
"### Toggle Component\n",
@@ -200,13 +200,13 @@
200200
{
201201
"cell_type": "code",
202202
"execution_count": 4,
203-
"id": "98c7d3fd",
203+
"id": "34614526",
204204
"metadata": {
205205
"execution": {
206-
"iopub.execute_input": "2025-04-07T21:20:40.204268Z",
207-
"iopub.status.busy": "2025-04-07T21:20:40.204182Z",
208-
"iopub.status.idle": "2025-04-07T21:20:40.207042Z",
209-
"shell.execute_reply": "2025-04-07T21:20:40.206742Z"
206+
"iopub.execute_input": "2025-04-09T20:19:08.365188Z",
207+
"iopub.status.busy": "2025-04-09T20:19:08.365098Z",
208+
"iopub.status.idle": "2025-04-09T20:19:08.368024Z",
209+
"shell.execute_reply": "2025-04-09T20:19:08.367761Z"
210210
}
211211
},
212212
"outputs": [
@@ -235,21 +235,21 @@
235235
}
236236
],
237237
"source": [
238-
"from pandas_render import load\n",
238+
"from pandas_render.utils import load\n",
239239
"\n",
240240
"load(libraries=\"alpinejs\")"
241241
]
242242
},
243243
{
244244
"cell_type": "code",
245245
"execution_count": 5,
246-
"id": "e6e8b870",
246+
"id": "5cecc2ef",
247247
"metadata": {
248248
"execution": {
249-
"iopub.execute_input": "2025-04-07T21:20:40.208408Z",
250-
"iopub.status.busy": "2025-04-07T21:20:40.208324Z",
251-
"iopub.status.idle": "2025-04-07T21:20:40.214124Z",
252-
"shell.execute_reply": "2025-04-07T21:20:40.213833Z"
249+
"iopub.execute_input": "2025-04-09T20:19:08.369282Z",
250+
"iopub.status.busy": "2025-04-09T20:19:08.369193Z",
251+
"iopub.status.idle": "2025-04-09T20:19:08.375172Z",
252+
"shell.execute_reply": "2025-04-09T20:19:08.374902Z"
253253
}
254254
},
255255
"outputs": [

examples/02_components.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@
8787
# The `Toggle` component is a simple toggle switch that can be used to show or hide content. It can be used to create interactive elements in your HTML table. First of all we need to load the `alpinejs` library. This is a JavaScript library that provides the functionality for the toggle component. The `load` function loads the library and makes it available for use in the HTML table.
8888

8989
# %%
90-
from pandas_render import load
90+
from pandas_render.utils import load
9191

9292
load(libraries="alpinejs")
9393

0 commit comments

Comments
 (0)