<jupyter_start><jupyter_text>Using the PSQL Database for Obiwan<jupyter_code>import psycopg2
import sys
import json
with open('config.json') as f:
    conf = json.load(f)
conn_str = "host={} dbname={} user={} password={}".format(conf['host'], conf['database'], conf['user'], conf['passw'])
conn = psycopg2.connect(conn_str)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.17280453257790368, 'fraction_numerical': 0.0056657223796034, 'mean_word_length': 8.31578947368421, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '500673', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 130, 'n_tokens_neox': 128, 'n_words': 27, 'path': 'doc/nb/db_tools.ipynb', 'repo_name': 'legacysurvey/obiwan', 'size': '353'}