This project feeds detailed mortgage market data to the Consumer Financial Protection Bureau's Owning a Home suite of tools. Unfortunately, the main data set it uses is not available publicly and is not in this repository.
What is included is the API code and some basic geographical data. If you want to give it a spin, here's how:
The tool is intended to be a module that runs inside a Django project, but it can be tested as a stand-alone app.
These instructions are for installation on a Mac with OS X Yosemite (version 10.10.x), but they could be adapted for other environments.
Dependencies
- Python 2.7
- pip
- virtualenv
- Django 1.8.15
- Django Rest Framework 3.1.3
- Django localflavor
- django-cors-headers
Optional
- It's useful to create a virtualenv virtual environment to keep Python dependencies sandboxed:
mkvirtualenv oah
- Create a folder for your Django project in a workspace or other location you like (
~/workspace
in this case), clone the project (or your fork of it) into your directory and install requirements:
cd ~/workspace
git clone https://github.com/cfpb/owning-a-home-api.git
cd owning-a-home-api/
setvirtualenvproject
pip install -r requirements/test.txt
- Initialize your database, load some basic data and launch a development server:
./manage.py migrate --noinput
./manage.py loaddata countylimit_data.json
./manage.py load_daily_data ratechecker/data/sample.zip
./manage.py runserver
You should be able to view these API pages locally:
- http://127.0.0.1:8000/oah-api/county/
- http://127.0.0.1:8000/oah-api/county/?state=FL
- http://127.0.0.1:8000/oah-api/rates/rate-checker
- http://127.0.0.1:8000/oah-api/rates/rate-checker-fees
You can install the API and its sister project, https://github.com/cfpb/owning-a-home, insdie the public project that powers consumerfinance.gov -- https://github.com/cfpb/cfgov-refresh
The cfgov-refresh documentation describes how to install sub-modules such as the owning-a-home API inside cfgov-refresh.
This repo contains limited data, but you can explore mortgage interest rates in detail at the CFPB's Interest-rate checker tool.
You can find more about using the API endpoints and the optional use of a MySQL database in our API documentation pages.
See also additional documentation for the ratechecker
app.
You can run Python unit tests and see code coverage by running:
./pytest.sh
We welcome contributions with the understanding that you are contributing to a project that is in the public domain, and anything you contribute to this project will also be released into the public domain. See our CONTRIBUTING file for more details.