Coder Social home page Coder Social logo

attomr's Introduction

attomr

The goal of attomr is to make calls to the ATTOM API easy from R! Relies on httr on the back end.

Installation

In development. You can install the current version of attomr from GitHub with:

devtools::install_github("juanfung/attomr")

Example

This is a basic example which shows you how to solve a common problem:

library(attomr)

## basic example code
## NB: requires setting apikey variable
apikey = 'YOUR_API_KEY'

## (optional) set user agent globally
set_ua('github.com/juanfung/attomr')

## create full endpoint path
path = build_path('basic')

## basic list of query parameters
query = build_query('basic')

## append query parameters
query = update_query(
    query,
    list(address='721 Evergreen Terrace, Springfield'))

## make the query
response = attom_api(path, query, apikey)

## you can more easily iterate through a list of addresses:
testlist = list(
    ## Throws an error but does not stop
    list(address='741 EVERGREEN TERRACE, SPRINGFIELD'),
    list(address='4529 Winona Court, Denver, CO')
)

testout = search_list(queries=testlist, apikey=apikey, s='basic')

## parse responses to (list of) tables
testdf = parse_list(testout)

List of available endpoints:

  • ‘id’: (/property/id) returns list of properties that fit criteria (bedrooms, geoid)
  • ‘basic’: (/property/basicprofile) returns basic property info, most recent sale and taxes
  • ‘detail’: (/property/detail) property characteristics, given address; or property details, given attomid
  • ‘snapshot’: (/property/snapshot) return properties that fall within radius of lat/long
  • ‘address’: (/property/address) return properties that dall within radius of address or postalcode
  • ‘sales’: (/sale/snapshot) return sales within radius of property

attomr's People

Contributors

juanfung avatar

Watchers

 avatar

attomr's Issues

`search_list()` stops when there is an error

In principle, each query in the list should be independent of the others, so if there is a GET error then that gets stored as the result. But this did not account for other errors, which will stop search_list() from completing the rest of the searches. Moreover, none of the results are saved. Shame!

Use tryCatch(). Duh

Post-processing function `parse_list` needs improvement

Function parse_list() assumes results returned in list form contains lists of data frames. Per 27c938a, results are now returned as list of lists. So parsing will be easier (list -> data frame) but code needs to be fixed.

Moreover, code should be more generic. Currently it assumes user is interested in the property item in the parsed result, but this may not exist for some of the other endpoints (e.g., sales).

Should also provide flexibility to choose subsets from list (eg, from property may only be interested in building info).

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.