Code Monkey home page Code Monkey logo

nexthome's Introduction

NextHome

Overview

This codebase is being used to gather and analyze data for places we might like to live around Boston, MA. Essentially, we use Python and several API's including Yelp and Google to collect information into a SQLite database, where further analysis can be done. For the sake of this project, we will provide the finished product of the database file (NextHome_database.db) in addition to the Python scripts interacting with the API's.

Documentation and links to various helpful components:

Yelp Fusion API documentation

Yelp Fusion examples - Github

Google Maps - Distance Matrix API documentation

Google Maps - Places API Web Service documentation

MA 2016 Presidential Voting Data By City

Using SQLite for analysis

As mentioned, we will try to keep the database up-to-date with some of the latest info. We'll include queries that can be run on the data in a file called report1.sql. Also, we recommend installing the program DB Browser for SQLite to see into NextHome_database.db.

How-to

Gathering from Yelp Fusion

Before doing anything else, run the following to install the dependencies: pip install -r requirements.txt.

To run the code without specifying any arguments (thereby utilizing the DEFAULT values we altered): python sample.py. Alternatively, run the code sample by specifying the optional arguments: python sample.py --term="bars" --location="San Francisco, CA"

Specifically, we've used the following files to pull information python yelp_api_to_json.py with optional parameters. Then to get into SQLite database use python yelptosql.py.

Gathering from Google Distance Matrix API

The first API calls we made were to determine how long morning commutes would be, via the Distance Matrix API. Just run python Google_Distance_Matrix_API.py to compile for all towns in MA against the target destination (Boston) to arrive by 8 a.m. It would definitely be possible to generalize the code and accept command-line inputs.

The next two files work in tandem to find Places of interest via the Place Search API. First python Google_Geolocate.py runs through the Towns list for MA to generate latitude and longitude, then python Google_places_by_town.py does API calls first for placeids for Places of Interest then finds details about the business with additional searches.

SQLite Analysis --Experimental

The queries in report1.sql are meant to run successfully against the SQLite file NextHome_database.db. No doubt there are minor alterations that we may make in the data post-insertion, which may not be included in report1.sql. Items that come to mind: deduping, replacing any '+' signs with regular spaces, etc. If issues are ever reported regarding these minor alterations that I performed manually, we could add commands into a new SQL file.

nexthome's People

Contributors

jmdavi avatar

Watchers

 avatar  avatar

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.