<commit_before>import sys
sys.path.append("../common")

import csv
import io

from sqlalchemy import create_engine
from sqlalchemy.engine import reflection

from flask import Flask
from flask import request

from flask_cors import CORS

import ConfigParser

config = ConfigParser.ConfigParser()
config.read('config.ini')
if len(config.sections()) == 0:
    print('config.ini file not yet present, please copy from template (templace_config.ini) and fill in required properties')
    quit()

engine = create_engine(config.get('DATAAPI', 'connection_string'))
insp = reflection.Inspector.from_engine(engine)
connection = engine.connect()

app = Flask(__name__)
cors = CORS(app)

def sql2csv(name, delimiter, quotechar):
    query = connection.execute("SELECT * FROM " + name).fetchall()<commit_msg>some tweaks in the directDB data api<commit_after>import sys
sys.path.append("../common")

import csv
import io

from sqlalchemy import create_engine
from sqlalchemy.engine import reflection

from flask import Flask
from flask import request

from flask_cors import CORS

import ConfigParser

config = ConfigParser.ConfigParser()
config.read('config.ini')
if len(config.sections()) == 0:
    print('config.ini file not yet present, please copy from template (templace_config.ini) and fill in required properties')
    quit()

engine = create_engine(config.get('DATAAPI', 'connection_string'))
insp = reflection.Inspector.from_engine(engine)

app = Flask(__name__)
cors = CORS(app)

def sql2csv(name, delimiter, quotechar):
    connection = engine.connect()
    query = connection.execute("SELECT * FROM " + name).fetchall()
    connection.close()

{'fraction_non_alphanumeric': 0.10407790626902008, 'fraction_numerical': 0.002434570906877663, 'mean_word_length': 5.421875, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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}}
{'dir': 'git-commits-cleaned', 'id': '6287607', 'n_tokens_mistral': 493, 'n_tokens_neox': 476, 'n_words': 146}