Giter VIP home page Giter VIP logo

owning-a-home-api's Introduction

Build StatusCoverage Status

Owning a Home API

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:

Installing it locally

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

Optional

Steps for firing up Django

  • 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 -e '.[testing]'
  • Initialize your database, load some basic data and launch a development server:
./manage.py migrate --noinput
./manage.py loaddata countylimits/fixtures/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:

Embedding the API module

You can install the API and its sister project, https://github.com/cfpb/owning-a-home, inside 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.

Data

This repo contains limited data, but you can explore mortgage interest rates in detail at the CFPB's Interest-rate checker tool.

Deeper dive

You can find additional documentation for the ratechecker app.

Running Tests

If you have Tox installed (recommended), you can run the specs for this project with the tox command.

If not, this command will run the specs on the python version your local environment has installed: ./manage.py test.

If you run the tests via Tox, it will automatically display spec coverage information. To get test coverage information outside of Tox, install Coverage.py and run these commands:

coverage erase
coverage run manage.py test
coverage report

API Docs

Documentation for this repository is rendered via GitHub pages. They can be edited in the docs/ directory, but to view or deploy them, you'll need to install the dependencies listed in the docs_extras section of setup.py:

pip install -e '.[docs]'

You can then preview your changes locally by running mkdocs serve and then reviewing http://127.0.0.1:8000/

When your changes are ready, you can submit them as a normal pull request. After that, you can use this command to publish them:

mkdocs gh-deploy --clean

That pushes the necessary files to the gh-pages branch.

Contributions

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.

owning-a-home-api's People

Contributors

alexm118 avatar amymok avatar cfarm avatar chosak avatar cwdavies avatar fna avatar higs4281 avatar hillaryj avatar jslay-excella avatar khandelwal avatar m3brown avatar marcesher avatar mistergone avatar orthographic-pedant avatar richaagarwal avatar rosskarchner avatar schbetsy avatar virginiacc avatar willbarton avatar wpears avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

owning-a-home-api's Issues

MySQL should not be required to run tests

The test_standalone.py script executes tests against a sqlite database. However, MySQL is required for two reasons:

MYSQL-python is listed in the requirements.txt, and this won't install without mysql_config installed on the system (e.g. via brew install mysql)

The ratechecker/management/commands/load_daily_data.py management command imports _mysql_exceptions, which causes tests to fail unless the MySQL stack is installed.

API parameter documentation

Querying the API endpoints for ratechecker and countylimits result in the following errors:

{
    "detail": "Required parameter 'loan_amount' is missing"
}
{
    "detail": "Required parameter state is missing"
}

As a new user of the application, it would be useful for the README to provide an overview of the parameters utilized in the ratechecker and countylimits APIs.

mock is required to run test_standalone.py

The mock library is required to run the test_standalone.py script, but mock is not included in the requirements.txt.

The need to install mock should be either mentioned in the README instructions, included in the requirements.txt, or added to something like requirements-test.txt

Provide some sample data for RateChecker

As a new user of the application, I can install the countylimits and ratechecker apps in a Django project, but there is no sample data or documentation regarding that data's format for the load_daily_data management command.

Despite the fact that we explicitly state that the app relies on data that is not available externally, sample data (or possibly test fixtures) would be useful in setting up copy of the ratechecker app.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.