from sqlalchemy import create_engine, text
import pandas as pd
engine = create_engine('postgresql://user:password@host:5432/dbname')
conn = engine.connect()
query = text("""SELECT * FROM core.sd_settings""")
df = pd.read_sql_query(query, conn)
print(df.head())
conn.close()
Примечание: требуется установка следующих компонентов
# requirements.txt
SQLAlchemy
psycopg2
pandas
# pip install -r requirements.txt