Created
March 15, 2022 12:05
-
-
Save kshirsagarsiddharth/55ab0e0b00bb505ec4d1e04f3a181993 to your computer and use it in GitHub Desktop.
con
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# I have stored my credentials in a json file | |
import json | |
import pandas as pd | |
import plotly.express as px | |
with open("creds.json","r") as f: | |
creds = json.load(f) | |
# my username | |
user = creds['user'] | |
# my password | |
password = creds['password'] | |
# name of my database | |
database_name = 'order_factory' | |
# Defining A connection string and making a connection | |
######################################################################## | |
%load_ext sql | |
connection_string = f"mysql://{user}:{password}@localhost/{database_name}" | |
%sql $connection_string | |
######################################################################## |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment