download_wrds.load_wrds_credentials()

Load WRDS credentials from environment variables or a ‘.env’ file.

Usage

Source

download_wrds.load_wrds_credentials()

Reads ‘WRDS_USER’ and ‘WRDS_PASSWORD’ from the process environment. If neither is set, also looks for a ‘.env’ file in the working directory via ‘load_dotenv’.

Returns

tuple of (str, str)
‘(wrds_user, wrds_password)’ pair suitable for building a SQLAlchemy connection URL.

Raises

ValueError
If either ‘WRDS_USER’ or ‘WRDS_PASSWORD’ is missing after the ‘.env’ file has been loaded.