def connect_nfldb():
    """Connect to the nfldb database.

    Rather than using the builtin method we make our own,
    since we're going to use SQLAlchemy as the engine. However,
    we can still make use of the information in the nfldb config
    file to get information like username and password, which
    means this function doesn't need any arguments.

    Parameters
    ----------
    None

    Returns
    -------
    SQLAlchemy engine object
        A connected engine, ready to be used to query the DB.

    Raises
    ------
    IOError
        If it can't find the config file.
    """
    import nfldb
    import sqlalchemy as sql
    db_config, paths_tried = nfldb.db.config()
    if db_config is None:
        raise IOError(
            'get_play_data: could not find database config! Looked in these places: {0}'
            .format(paths_tried))
    db_config['drivername'] = 'postgres'
    db_config['username'] = db_config['user']
    del db_config['user']
    del db_config['timezone']
    engine = sql.create_engine(sql.engine.url.URL(**db_config))
    return engine
