<commit_before>#! /usr/local/bin/python2.7
#coding=utf-8

#  docdb: Simple Document DB.
#
#  Copyright (C) 2012 <NAME> (<EMAIL>)
#

__version__ = 0.1
__doc__ = """ docdb module - A simple document DB on top of sqlite, mysql or posgre..

DocDB(dbpath) - returns a new DB object implementing the given functions;
                dbpath sets the DB file to use. If none given, a db0.db
                file will be created.

DocDB objects have these methods:

 - get(key):        Gets the object stored in key. If there is no object,
                    None is returned.
 - set(key, doc):   Stores document doc into the DB using key as the index.
                    When successfull True is returned. If a document is
                    updated, the previous version is stored (and accessible
                    through versions().
 - mget(*args):     Multiple get. Receives multiple arguments, and returns
                    the related documents.
 - mset(*args):     Multiple set. Receives multiple tuples (key, doc) as
                    arguments, and stores the documents for the given keys.
 - versions(key):   Returns all the history of documents stored under a
                    given key.
 - info():          Return a dict with DB info (filesize, number of keys).
 - keys():          Returns a list of all the existing keys in DB.
 - flushall():      Removes all the documents from the DB. Complete delete.
 - compact():       Deletes all the old version documents from the DB,<commit_msg>small changes in docdb.py<commit_after>#! /usr/local/bin/python2.7
#coding=utf-8

#  docdb: Simple Document DB...
#
#  Copyright (C) 2012 <NAME> (<EMAIL>)
#

__version__ = 0.1
__doc__ = """ docdb module - A simple document DB on top of sqlite, mysql or posgre..

DocDB(dbpath) - returns a new DB object implementing the given functions;
                dbpath sets the DB file to use. If none given, a db0.db
                file will be created.

DocDB objects have these methods:

 - get(key):        Gets the object stored in key. If there is no object,
                    None is returned.
 - set(key, doc):   Stores document doc into the DB using key as the index.
                    When successfull True is returned. If a document is
                    updated, the previous version is stored (and accessible
                    through versions().
 - mget(*args):     Multiple get. Receives multiple arguments, and returns
                    the related documents.
 - mset(*args):     Multiple set. Receives multiple tuples (key, doc) as
                    arguments, and stores the documents for the given keys.
 - versions(key):   Returns all the history of documents stored under a
                    given key.
 - info():          Return a dict with DB info (filesize, number of keys).
 - keys():          Returns a list of all the existing keys in DB.
 - flushall():      Removes all the documents from the DB. Complete delete.
 - compact():       Deletes all the old version documents from the DB,
{'fraction_non_alphanumeric': 0.07582781456953643, 'fraction_numerical': 0.006622516556291391, 'mean_word_length': 2.1240951396070322, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '578146', 'n_tokens_mistral': 799, 'n_tokens_neox': 758, 'n_words': 380}