<jupyter_start><jupyter_text>Insert record into database<jupyter_code>import db_helpers.zillow_db as zdb
conn = zdb.connect_to_zillow_db()
c = conn.cursor()
prop_attrs['url'],
prop_attrs['parcel_number'],
prop_attrs['address'],
prop_attrs['zip_code'],
prop_attrs['school_district'],
prop_attrs['list_price'],
prop_attrs['list_date'],
prop_attrs['bedrooms'],
prop_attrs['bathrooms'],
prop_attrs['full_bathrooms'],
prop_attrs['bathrooms_3_4'],
prop_attrs['bathrooms_1_2'],
prop_attrs['bathrooms_1_4'],
prop_attrs['basement'],
prop_attrs['new_construction'],
prop_attrs['year_built'],
prop_attrs['home_type'],
prop_attrs['stories'],
prop_attrs['total_interior_livable_area_sqft'],
prop_attrs['lot_size_acres'],
prop_attrs['region'],
prop_attrs['tax_assessed_value_dollars'],
prop_attrs['annual_tax_amount_dollars'],
prop_attrs['mls_id'],
prop_attrs['mlsstatus']
prop_attrs['url'],
prop_attrs['parcel_number'],
prop_attrs['address'],
prop_attrs['zip_code'],
prop_attrs['school_district'],
prop_attrs['list_price'],
prop_attrs['list_date'],
prop_attrs['bedrooms'],
prop_attrs['bathrooms_total'],
prop_attrs['bathrooms_full'],
prop_attrs['bathrooms_3_4'],
prop_attrs['bathrooms_1_2'],
prop_attrs['bathrooms_1_4'],
prop_attrs['basement'],
prop_attrs['new_construction'],
prop_attrs['year_built'],
prop_attrs['home_type'],
prop_attrs['stories'],
prop_attrs['total_interior_livable_area_sqft'],
prop_attrs['lot_size_acres'],
prop_attrs['region'],
prop_attrs['tax_assessed_value_dollars'],
prop_attrs['annual_tax_amount_dollars'],
prop_attrs['mls_id'],
prop_attrs['mlsstatus'],
import datetime

list(range(5))
prop_attrs = {}
zdb.insert_listing_record(conn, record = prop_attrs)
zdb.get_listing_by_url(conn, {'url': prop_attrs['url']})
c.execute("SELECT * FROM zillow_listings")
import pandas as pd
record = pd.read_sql("""SELECT * 
                        FROM zillow_listings 
                        WHERE url='https://www.zillow.com/homedetails/5167-Valley-Ridge-Rd-Cincinnati-OH-45247/34341791_zpid/'
                     """, conn)
record.to_dict('records')[0] == prop_attrs
record.to_dict('records')[0]
from operator import itemgetter
itemgetter('url', 'address')[prop_attrs]
prop_attrs['url']
pd.DataFrame.from_dict(prop_attrs, orient='columns')
record.isin
c.fetchall()
c.execute("delete from zillow_listings")
conn.close()
len([])<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16186440677966102, 'fraction_numerical': 0.013559322033898305, 'mean_word_length': 9.981395348837209, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 1, 'lorem ipsum': 0, 'www.': 1, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '291806', 'license': 'MIT', 'n_tokens_mistral': 879, 'n_tokens_neox': 853, 'n_words': 104, 'path': 'notebooks/test_zillow_scraper.ipynb', 'repo_name': 'gw-moore/home_data_scraper', 'size': '2360'}