<commit_before>#!/usr/bin/env python

import os
import json
import ligneous

logger = ligneous.log("SkeletonDB") 


def load(location="skeleton.db", fsave=True, verbose=True):
    '''Return a SkeletonDB object. location is the path to the json file.'''
    return Database(location, fsave, verbose)


class Database(object):

    def __init__(self, location="skeleton.db", fsave=True, verbose=True):
        '''Creates a database object and loads the data from the location path.
        If the file does not exist it will be created on the first update.'''
        self.verbose = verbose
        self.load(location, fsave)
<commit_msg>key value database for caching<commit_after>#!/usr/bin/env python

import os
import json
import ligneous

logger = ligneous.log("database") 


def load(location="skeleton.db", fsave=True, verbose=True):
    '''Return a SkeletonDB object. location is the path to the json file.'''
    return Database(location, fsave, verbose)


class Database(object):

    def __init__(self, location="skeleton.db", fsave=True, verbose=True):
        '''Creates a database object and loads the data from the location path.
        If the file does not exist it will be created on the first update.'''
        self.verbose = verbose
        self.load(location, fsave)

{'fraction_non_alphanumeric': 0.10256410256410256, 'fraction_numerical': 0.0, 'mean_word_length': 3.7527675276752768, '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': '5414342', 'n_tokens_mistral': 381, 'n_tokens_neox': 358, 'n_words': 138}