This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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", |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
BEGIN; | |
CREATE TABLE "airdata"."review" | |
( | |
"listing_id" BIGINT NOT NULL, | |
"id" BIGINT NOT NULL, | |
"date" timestamptz, | |
"reviewer_id" BIGINT, | |
"reviewer_name" TEXT, | |
"comments" TEXT, |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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, |