notebooks/template.ipynb (67 lines of code) (raw):

{ "cells": [ { "cell_type": "code", "execution_count": null, "metadata": { "id": "" }, "outputs": [ ], "source": [ "# Licensed under the Apache License, Version 2.0 (the \"License\"); { display-mode: \"form\" }\n", "# you may not use this file except in compliance with the License.\n", "# You may obtain a copy of the License at\n", "#\n", "# https://www.apache.org/licenses/LICENSE-2.0\n", "#\n", "# Unless required by applicable law or agreed to in writing, software\n", "# distributed under the License is distributed on an \"AS IS\" BASIS,\n", "# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n", "# See the License for the specific language governing permissions and\n", "# limitations under the License." ] }, { "cell_type": "code", "outputs": [], "source": [ "import pandas as pd\n", "\n", "from playground.db_engine import create_db_engine\n", "\n", "DB_URL = \"mysql://merico:merico@127.0.0.1:3306/lake\"\n", "\n", "engine = create_db_engine(DB_URL)\n", "\n", "df = pd.read_sql(\"SELECT * FROM calendar_months\", engine)\n", "\n", "print(df)" ], "metadata": { "collapsed": false } } ], "metadata": { "kernelspec": { "display_name": ".venv", "language": "python", "name": "python3" }, "language_info": { "codemirror_mode": { "name": "ipython", "version": 3 }, "file_extension": ".py", "mimetype": "text/x-python", "name": "python", "nbconvert_exporter": "python", "pygments_lexer": "ipython3", "version": "3.11.8" } }, "nbformat": 4, "nbformat_minor": 2 }