Created
September 22, 2020 20:59
-
-
Save pfmoore/a5bfdede9646bb7be0dc4d7b445aa338 to your computer and use it in GitHub Desktop.
A SQL query runner using Pandas
This file contains hidden or 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
# A SQL query runner using Pandas | |
# pip install pandas tabulate sqlalchemy | |
import pandas as pd | |
from tabulate import tabulate | |
# import sqlite3 | |
df = pd.read_sql( | |
"select name, downloaded, serial from projects limit 20", | |
"sqlite:///PyPI.db" | |
# sqlite3.connect("PyPI.db") | |
) | |
print(tabulate(df, headers='keys', tablefmt='psql')) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment