Code Monkey home page Code Monkey logo

landlord-tracker's Introduction

landlord-tracker

Running this

This should work on Linux, Mac, and Windows.

  • install docker

  • if you're on Windows, run git config --global core.autocrlf false

  • clone this repo

  • unzip the data package zipfile into the ./data directory

cd data
unzip /path/to/data.zip
  • start services required for the build:
# docker build needs buildkit enabled
export DOCKER_BUILDKIT=1

# copy sample .env file
cp .env-sample .env

# starts the database and other services:
docker compose up --build -d
  • to do a full run of the data build (loading and transforming the data):
# run the entire build
# on windows, add "winpty" to the front
docker compose run elt build-all

You'll see a "Finished build" message when it's finished. You can connect to the postgres database on localhost:5433 using a SQL client (like DBeaver) or use psql:

docker exec -it landlord-tracker-db-1 psql -U postgres

  • to run the address report (replace 123 MAIN ST with a real address of an apartment complex):
docker compose run elt python3 -m engels.reports.report_address "123 MAIN ST"
  • to stop the stack, run docker compose down. This stops the postgres database, but the data should be preserved and available agaion the next time you run compose up.

Doing Development

note: on windows, add "winpty" to the front of docker commands to get interactivity and avoid output buffering

Dev Process

To (re)run only the load or transforms as you are doing development:

# re-runs only the initial load of database tables
docker compose run elt load

# re-runs only the transforms
docker compose run elt transform

# you can also run bash in the container and run other things
docker compose run elt bash

Documentation

After running the transform step, you can view the updated dbt-generated HTML documentation at http://localhost:8000 to get a thousand foot view of the pipelines.

Naming Conventions

For tables:

pre_ - data preprocessed from raw files

raw_ - raw aka source tables, imported into the database directly from extract files

int_ - intermediate tables; these only exist to help create other tables.

stg_ - staged data: these are cleaned versions of raw tables, suitable for querying.

ent_ - derived entity tables built from staging

vld_ - for validation

landlord-tracker's People

Contributors

sprucelee avatar thomasbjones2 avatar sprovence avatar thomasdapaine avatar kingcountylandlordproject avatar

Forkers

sea-kelp

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.