This is a landing page and documentation file for the course Github repository that I use when I teach FIN657. Eventually, it may become the main course page. For now, if you’re looking for information about the course, including topics, schedule, assignments, and grading, please see the syllabus, or contact me directly.
This repository contains the files used when I teach the course. It is a collection of slides, Python notebooks, and other materials. Students in this course are required to run the code contained in this repository in order to understand course concepts and complete homework assignments.
The rest of this page explains how to set up your environment and run the code. You have two options: run the code on the web through GitHub Codespaces (easier), or locally on your own computer (more advanced). Either way, you will first need to get access to the FRED and WRDS databases.
You will need to set up access to two databases, FRED and WRDS.
Once you have your FRED API key and WRDS username, proceed to either of the next two options.
GitHub Codespaces provides a cloud-based development environment that automatically sets up everything you need to run our course notebooks. This is the recommended approach for getting started.
(You will need to create a free GitHub account if you don’t already have one, but this is strongly recommended anyway. If you really don’t want to create a GitHub account, see the next section and download the repo as a ZIP file.)
For those who already use VSCode locally, you can also connect to your codespace from there instead of the browser: open the Command Palette (Ctrl+Shift+P / Cmd+Shift+P), type “Connect to Codespace”, and select the codespace you just created.
This is a middle ground between a completely browser-based approach (above) and a completely local approach (below).
Note about other cloud systems: Github Codespaces is our preferred cloud-based system, but there are many popular alternatives with similar functionality (e.g. Binder or Colab). If you use any such system, please be careful at all times with your database credentials. Only enter them into an appropriate secrets-handling system, not into the text of the notebook file itself. On some of these systems (including Binder) there is no secrets handler at all, in which case you should not use that system to run any code from this class that connects to a database.
Your own computer can easily run all the code that we use in class if you install a few components that it will look for. This takes a bit more work, but gives a much better experience after that.
git clone https://github.com/wgmann/FIN657
cd FIN657
If you don’t have a GitHub account and don’t want to create one, then download the repo as a zip folder from this site, extract it, and navigate into the directory that is created.
conda env create -f environment.yml
conda activate FIN657
python -m ipykernel install --user --name FIN657 --display-name "FIN657"
.env:.env.example to a new one named .env (note the . at the start of the filename!)
cp .env.example .env
Then open the file .env that you just created. You will see the following lines:
FRED_API_KEY=YOUR_FRED_API_KEY
WRDS_USERNAME=YOUR_WRDS_USERNAME
Replace everything after the = with your info, and do not use quote marks. For example,
FRED_API_KEY=abc123
WRDS_USERNAME=johndoe
The load_dotenv() function that appears at the start of every notebook will load this information automatically.
.ipynb files): If using VSCode, then just open the repo directory you created, select the FIN657 kernel (if this does not happen automatically), and navigate to any file to open and run it.jupyter notebook to launch a browser window with a view of the course files. If it does not happen automatically, look for a URL in the output of the command, copy and paste it into a browser window.FIN657 kernel if this does not happen automatically.jupyter notebook, and enter Ctrl+C to kill it.This repository contains instructional materials and a small amount of supporting software code.
.ipynb),
written explanations, examples, and course content, are licensed under
the Creative Commons Attribution–NonCommercial 4.0 International License..py scripts intended for reuse
outside the instructional context) are licensed under the MIT License.See LICENSE and LICENSE-CODE for details.