Technical requirements
In this chapter, we will be using pandas 2.2.2 (released April 10, 2024) extensively.
You will be working with different types of databases, such as PostgreSQL, Amazon Redshift, MongoDB, InfluxDB, and Snowflake. You will need to install additional Python libraries to connect to these databases.
You can also download the Jupyter notebooks from this book's GitHub repository (https://github.com/PacktPublishing/Time-Series-Analysis-with-Python-Cookbook) to follow along.
As a good practice, you will store your database credentials in a config database.cfg
file outside your Python script. You can use configparser
to read and store the values in Python variables. You do not want your credentials exposed or hard coded in your code:
# Example of configuration file "database.cfg file"
[SNOWFLAKE]
user=username
password=password
account=snowflakeaccount
warehouse=COMPUTE_WH
database=SNOWFLAKE_SAMPLE_DATA
schema=TPCH_SF1
role=somerole
[POSTGRESQL]
host: 127...