Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: update libro guide book #333

Merged
merged 1 commit into from
Nov 25, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.
Loading