Python ile ETL ve ELT
Jake Roach
Data Engineer


pandas, veriyi SQL'e kalıcılaştırmak için .to_sql() sağlar
nameconif_existsindexindex_label# Create a connection object
connection_uri = "postgresql+psycopg2://repl:password@localhost:5432/market"
db_engine = sqlalchemy.create_engine(connection_uri)
# Use the .to_sql() method to persist data to SQL
clean_stock_data.to_sql(
name="filtered_stock_data",
con=db_engine,
if_exists="append",
index=True,
index_label="timestamps"
)
Verinin beklendiği gibi kalıcılaştığını doğrulamak önemlidir.
# SQL tablosuna yazılan veriyi çekin
to_validate = pd.read_sql("SELECT * FROM cleaned_stock_data", db_engine)
# Sayımları, kayıt eşitliğini vb. doğrulayın
...
Python ile ETL ve ELT