import redis
import json
import os.path
from sqlalchemy import create_engine
from sqlalchemy.orm import sessionmaker
import socket
import markovify
import nltk
import re
basepath = os.path.dirname(__file__)
with open(os.path.abspath(os.path.join(basepath, "..", "config.json")), "r") as config:
config = json.load(config)
redis = redis.StrictRedis(host=config["redis"]["host"], port=config["redis"]["port"],
db=config["redis"]["db"])
db = create_engine(config["database"])
Session = sessionmaker(bind=db)
session = Session()