summaryrefslogtreecommitdiff
path: root/scripts/pyranking/db.py
blob: f30a555cdec9aa05c9a1414fecd773e7e0d25c59 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
import json
import mysql.connector

settings = json.load(open('config/db.json'))

connection = mysql.connector.connect(
    user=settings['user'],
    password=settings['pass'],
    host=settings['host'],
    port=settings['port'],
    database=settings['db']
)
cursor = connection.cursor(dictionary=True, buffered=True)