Configuring your local environment
There are many ways to set up configuration files in your ETL project repositories. We will utilize two different forms, a config.ini
file and a config.yaml
file. Both work equally well, but we will use the config.yaml
version more frequently. This is more of a “dealer’s choice” situation than anything else.
config.ini
Open the config.ini
file and replace username
and password
with the credentials for your local PostgreSQL environment:
[postgresql]host = localhost port = 5432 database = chicago_dmv user = postgres password = password
To import the config.ini
file in the chapter_08/
directory to your p0#_<module>_pipeline.py
file, we will use the following syntax:
# Read the Configuration Fileimport configparser config = configparser.ConfigParser() config.read('config.ini')
config.yaml
Open the config.yaml
file and perform the same task to replace username
and password
with the credentials for...