Skip to content

Instantly share code, notes, and snippets.

View lenalytics's full-sized avatar
💚
Working from home

Lena Tru lenalytics

💚
Working from home
View GitHub Profile
@lenalytics
lenalytics / main.py
Created August 1, 2021 11:25
Airbnb ETL
import csv
import psycopg2
from ast import literal_eval
from re import sub
def connect():
connection = psycopg2.connect(user="xxx",
password="xxx",
host="xxx",
port="5432",
@lenalytics
lenalytics / calendar.sql
Created August 1, 2021 11:18
Airbnb Calendar Table
BEGIN;
CREATE TABLE "airdata"."calendar"
(
"listing_id" BIGINT NOT NULL,
"date" timestamptz,
"available" BOOLEAN,
"price" DECIMAL,
"adjusted_price" DECIMAL,
"minimum_nights" INTEGER,
"maximum_nights" INTEGER,
@lenalytics
lenalytics / review.sql
Created August 1, 2021 11:17
Airbnb Review Table
BEGIN;
CREATE TABLE "airdata"."review"
(
"listing_id" BIGINT NOT NULL,
"id" BIGINT NOT NULL,
"date" timestamptz,
"reviewer_id" BIGINT,
"reviewer_name" TEXT,
"comments" TEXT,
@lenalytics
lenalytics / listing.sql
Created August 1, 2021 11:14
Airbnb - Listing Table
BEGIN;
CREATE TABLE "airdata"."listing"
(
"id" BIGINT NOT NULL,
"listing_url" TEXT,
"scrape_id" BIGINT NOT NULL,
"last_searched" timestamptz,
"last_scraped" timestamptz,
"name" TEXT,