Skip to content

Commit

Permalink
docs: update libro guide book
Browse files Browse the repository at this point in the history
  • Loading branch information
sunshinesmilelk committed Nov 25, 2024
1 parent 062ce1b commit bc0edda
Show file tree
Hide file tree
Showing 2 changed files with 188 additions and 7 deletions.
195 changes: 188 additions & 7 deletions examples/libro_guide_book.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -84,28 +84,209 @@
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 5,
"id": "12b0e2fa-a4a4-4e17-affb-2dd10ad3cabe",
"metadata": {
"execution": {},
"execution": {
"shell.execute_reply.end": "2024-11-21T17:06:50.333591Z",
"shell.execute_reply.started": "2024-11-21T17:06:50.308065Z",
"to_execute": "2024-11-21T17:06:50.301Z"
},
"libroCellType": "sql",
"libroFormatter": "formatter-sql-magic"
},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>name</th>\n",
" <th>price</th>\n",
" <th>quantity</th>\n",
" <th>created_at</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>Laptop</td>\n",
" <td>999.99</td>\n",
" <td>10</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>Smartphone</td>\n",
" <td>499.99</td>\n",
" <td>25</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>Tablet</td>\n",
" <td>299.99</td>\n",
" <td>15</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" <td>Headphones</td>\n",
" <td>79.99</td>\n",
" <td>50</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5</td>\n",
" <td>Smartwatch</td>\n",
" <td>199.99</td>\n",
" <td>20</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id name price quantity created_at\n",
"0 1 Laptop 999.99 10 2024-11-21 17:06:45\n",
"1 2 Smartphone 499.99 25 2024-11-21 17:06:45\n",
"2 3 Tablet 299.99 15 2024-11-21 17:06:45\n",
"3 4 Headphones 79.99 50 2024-11-21 17:06:45\n",
"4 5 Smartwatch 199.99 20 2024-11-21 17:06:45"
]
},
"metadata": {},
"output_type": "display_data"
}
],
"source": [
"%%sql \n",
"{\"result_variable\":\"df_1\",\"db_id\":\"sqlite: sql_demo\",\"sql_script\":\"select * from products\"}"
]
},
{
"cell_type": "code",
"execution_count": null,
"execution_count": 6,
"id": "83edeb90-a116-4ed2-b80e-c0a534e365c0",
"metadata": {
"execution": {},
"execution": {
"shell.execute_reply.end": "2024-11-21T17:07:02.840207Z",
"shell.execute_reply.started": "2024-11-21T17:07:02.820197Z",
"to_execute": "2024-11-21T17:07:02.843Z"
},
"libroFormatter": "formatter-string"
},
"outputs": [],
"outputs": [
{
"data": {
"text/html": [
"<div>\n",
"<style scoped>\n",
" .dataframe tbody tr th:only-of-type {\n",
" vertical-align: middle;\n",
" }\n",
"\n",
" .dataframe tbody tr th {\n",
" vertical-align: top;\n",
" }\n",
"\n",
" .dataframe thead th {\n",
" text-align: right;\n",
" }\n",
"</style>\n",
"<table border=\"1\" class=\"dataframe\">\n",
" <thead>\n",
" <tr style=\"text-align: right;\">\n",
" <th></th>\n",
" <th>id</th>\n",
" <th>name</th>\n",
" <th>price</th>\n",
" <th>quantity</th>\n",
" <th>created_at</th>\n",
" </tr>\n",
" </thead>\n",
" <tbody>\n",
" <tr>\n",
" <th>0</th>\n",
" <td>1</td>\n",
" <td>Laptop</td>\n",
" <td>999.99</td>\n",
" <td>10</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>1</th>\n",
" <td>2</td>\n",
" <td>Smartphone</td>\n",
" <td>499.99</td>\n",
" <td>25</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>2</th>\n",
" <td>3</td>\n",
" <td>Tablet</td>\n",
" <td>299.99</td>\n",
" <td>15</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>3</th>\n",
" <td>4</td>\n",
" <td>Headphones</td>\n",
" <td>79.99</td>\n",
" <td>50</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" <tr>\n",
" <th>4</th>\n",
" <td>5</td>\n",
" <td>Smartwatch</td>\n",
" <td>199.99</td>\n",
" <td>20</td>\n",
" <td>2024-11-21 17:06:45</td>\n",
" </tr>\n",
" </tbody>\n",
"</table>\n",
"</div>"
],
"text/plain": [
" id name price quantity created_at\n",
"0 1 Laptop 999.99 10 2024-11-21 17:06:45\n",
"1 2 Smartphone 499.99 25 2024-11-21 17:06:45\n",
"2 3 Tablet 299.99 15 2024-11-21 17:06:45\n",
"3 4 Headphones 79.99 50 2024-11-21 17:06:45\n",
"4 5 Smartwatch 199.99 20 2024-11-21 17:06:45"
]
},
"execution_count": 6,
"metadata": {},
"output_type": "execute_result"
}
],
"source": [
"df_1"
]
Expand Down Expand Up @@ -335,7 +516,7 @@
"\n",
"https://github.com/difizen/libro\n",
"\n",
"**libro,不只是笔记本,更是一个 灵感加速器!**"
"**libro,不只是笔记本,更是一个灵感加速器!**"
]
}
],
Expand Down
Binary file added examples/sql_demo
Binary file not shown.

0 comments on commit bc0edda

Please sign in to comment.