<commit_before>from konf import Konf
from good import Schema, Optional, Extra, Reject, Invalid, Any, Fallback
from collections import Counter

#TODO: use messages to explain what's wrong in the config
is_valid_server_conf = Schema({
    'port' : Any(int, Fallback(5000)),
    'debug' : Any(bool, Fallback(True))
})

def parse(filename):
    k = Konf(filename)

    # syntax:
    config = {
        'server' : k('server', is_valid_server_conf)
    }

    # semantics:

    return config
<commit_msg>Add steam api key to config<commit_after>from konf import Konf
from good import Schema, Optional, Extra, Reject, Invalid, Any, Fallback
from collections import Counter

#TODO: use messages to explain what's wrong in the config
is_valid_server_conf = Schema({
    'port' : Any(int, Fallback(5000)),
    'debug' : Any(bool, Fallback(True))
})

def parse(filename):
    k = Konf(filename)

    # syntax:
    config = {
        'server' : k('server', is_valid_server_conf),
        'steam api key' : k('steam api key', str)
    }

    # semantics:

    return config

{'fraction_non_alphanumeric': 0.11215834118755891, 'fraction_numerical': 0.007540056550424128, 'mean_word_length': 3.617391304347826, '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': '7194535', 'n_tokens_mistral': 352, 'n_tokens_neox': 332, 'n_words': 108}