<jupyter_start><jupyter_text>Generate a unique app table<jupyter_code>import functions as fn
import psycopg2
import io
from sqlalchemy import create_engine
# load the above mentioned pickle
with open('initial_5pct_transactions.pkl', 'rb') as f:
    initial_5pct = pickle.load(f)<jupyter_output><empty_output><jupyter_text>Extract app information from bson<jupyter_code># Run get_app_specific_information to process all transactions and extract app information
apps_df = fn.get_app_specific_information(initial_5pct)
apps_df<jupyter_output><empty_output><jupyter_text>Dropping resulting app table into the venmo_transactions db<jupyter_code># Retrieve information about the venmo_transactions db
keys = fn.get_keys("/Users/jjherranzsarrion/.secret/local_info.json")
username = keys['username']
password = keys['password']
# Dump apps_df table into the database
engine = create_engine(f'postgresql://{username}:{password}@localhost/venmo_transactions')
apps_df.to_sql('app_info', engine)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.08866995073891626, 'fraction_numerical': 0.003940886699507389, 'mean_word_length': 9.16, 'pattern_counts': {'":': 0, '<': 13, '<?xml version=': 0, '>': 13, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, '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': '3', 'dir': 'jupyter-structured-clean-dedup', 'id': '126728', 'license': 'MIT', 'n_tokens_mistral': 332, 'n_tokens_neox': 329, 'n_words': 74, 'path': 'data_prep_app_info.ipynb', 'repo_name': 'fromdatavistodatascience/venmo', 'size': '1015'}