<commit_before>import os
import configparser
from jarvis_cli.exceptions import JarvisCliConfigError
from jarvis_cli.client import DBConn


def get_client_connection(environment):
    config = configparser.ConfigParser()
    config_path = os.path.join(os.environ["HOME"], ".jarvis", "cli_config.ini")

    if config.read(config_path):
        return DBConn(config[environment]["host"], config[environment]["port"])
    else:
        raise JarvisCliConfigError("Configuration not setup: {0}".format(config_path))
<commit_msg>Expand config to include jarvis data directories<commit_after>import os
import configparser
from jarvis_cli.exceptions import JarvisCliConfigError
from jarvis_cli.client import DBConn

JARVIS_CLI_DIRECTORY = os.path.join(os.environ["HOME"], ".jarvis")


def _get_config(environment):
    config = configparser.ConfigParser()
    config_path = os.path.join(JARVIS_CLI_DIRECTORY, "cli_config.ini")

    if config.read(config_path):
        return config[environment]
    else:
        raise JarvisCliConfigError("Configuration not setup: {0}".format(config_path))

def get_client_connection(environment):
    config = _get_config(environment)
    return DBConn(config["host"], config["port"])

def get_jarvis_data_directory(environment):
    config = _get_config(environment)
    return config["data_directory"]

def get_jarvis_snapshots_directory(environment):
    config = _get_config(environment)
    return config["snapshots_directory"]
{'fraction_non_alphanumeric': 0.10198494182067078, 'fraction_numerical': 0.0013689253935660506, 'mean_word_length': 5.768518518518518, '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': '6233120', 'n_tokens_mistral': 435, 'n_tokens_neox': 426, 'n_words': 88}