Skip to content

Latest commit

 

History

History
105 lines (87 loc) · 3.05 KB

README.md

File metadata and controls

105 lines (87 loc) · 3.05 KB

crib

nice crib

Installation

Navigate to the latest release and download the binary for your OS.
Assuming it's mac, here's how to install v2.0.2:

$ curl -L https://github.com/peppys/crib/releases/download/2.0.2/crib_Darwin_arm64.tar.gz --output crib.tar.gz 

$ tar -xzvf crib.tar.gz

CLI Usage

$ ./crib value --help
Checks the estimated valuation of your property

Usage:
  cli value [flags]

Flags:
  -a, --address string   Address of your crib
  -f, --format string    Format of output (table/json/csv) (default "table")
  -h, --help             help for value

Machine readable formats

note: machine readable formats display estimates in cents / pennies

csv

crib value -a '1443 devlin dr, los angeles, ca' --format csv
 ██████ ██████  ██ ██████  
██      ██   ██ ██ ██   ██ 
██      ██████  ██ ██████  
██      ██   ██ ██ ██   ██ 
 ██████ ██   ██ ██ ██████  

Provider,Estimate                                                                                                                                                                                                                       
redfin,783541324
zillow,756970000

json

crib value -a '1443 devlin dr, los angeles, ca' --format json
 ██████ ██████  ██ ██████  
██      ██   ██ ██ ██   ██ 
██      ██████  ██ ██████  
██      ██   ██ ██ ██   ██ 
 ██████ ██   ██ ██ ██████  

[                                                                                                                                                                                                                          
  {
    "provider": "redfin",
    "value": 783541324
  },
  {
    "provider": "zillow",
    "value": 756970000
  }
]

json format can be paired with jq to calculate average value:

crib value -a '1443 devlin dr, los angeles, ca' --format json | jq 'map(.value) | add/length'
 ██████ ██████  ██ ██████  
██      ██   ██ ██ ██   ██ 
██      ██████  ██ ██████  
██      ██   ██ ██ ██   ██ 
 ██████ ██   ██ ██ ██████  

770255662                         

Library Usage

package main

import (
	"github.com/peppys/crib/pkg/crib"
	"github.com/peppys/crib/pkg/crib/estimators"
	"log"
)

func main() {
	c := crib.New(
		crib.WithEstimators(
			estimators.DefaultZillowEstimator(),
			estimators.DefaultRedfinEstimator(),
		),
	)

	estimates, err := c.Estimate("1443 delvin dr los angeles, ca")
	if err != nil {
		log.Fatal(err)
	}

	log.Printf("found estimates: %+v", estimates)
}

CLI Demo

demo