download_wrds.set_wrds_credentials()
Set WRDS credentials in a ‘.env’ file.
Usage
download_wrds.set_wrds_credentials()Prompts interactively for the WRDS username and password and writes them to a ‘.env’ file as ‘WRDS_USER’ and ‘WRDS_PASSWORD’. The location is chosen at the prompt: ‘project’ writes to the current working directory, ‘home’ writes to the user’s home directory. If a ‘.env’ file already contains WRDS credentials, the user is asked before overwriting. After saving, the user is offered to append ‘.env’ to a sibling ‘.gitignore’ (recommended).
The resulting ‘.env’ file is the credentials source consumed by ‘get_wrds_connection’ via ‘load_wrds_credentials’.
Returns
None- Called for its side effects: writing ‘.env’ and, optionally, updating ‘.gitignore’.
See Also
- get_wrds_connection()
-
Opens a WRDS connection using the credentials stored by this function.
Examples
from tidyfinance import set_wrds_credentials
set_wrds_credentials()