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

settings = json.load(file('config.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)