<commit_before>import os
from flask import Flask, abort, request
from flask.ext import restful
from vaux.storage import LibreDB
from datetime import datetime
from werkzeug import secure_filename
from cors import crossdomain

app = Flask(__name__)
database = LibreDB('../data', 'localhost', 28015, 'docliber')

from peer import PeerResource, PeerInstance
from document import DocumentResource, DocumentInstance

api = restful.Api(app)

api.decorators=[crossdomain(origin='*')]

api.add_resource(PeerResource, '/peers/')
api.add_resource(PeerInstance, '/peers/<string:id>/')
api.add_resource(DocumentResource, '/documents/')
api.add_resource(DocumentInstance, '/documents/<string:id>/')<commit_msg>Read in the database and data options from a config file<commit_after>import os
import ConfigParser
from flask import Flask, abort, request
from flask.ext import restful
from vaux.storage import LibreDB
from datetime import datetime
from werkzeug import secure_filename
from cors import crossdomain

app = Flask(__name__)

config = ConfigParser.SafeConfigParser()
config.read('/etc/vaux.ini')

database = LibreDB(
    config.get('data', 'path'),
    config.get('database', 'host'),
    config.getint('database', 'port'),
    config.get('database', 'database'))

from peer import PeerResource, PeerInstance
from document import DocumentResource, DocumentInstance

api = restful.Api(app)

api.decorators=[crossdomain(origin='*')]

api.add_resource(PeerResource, '/peers/')
api.add_resource(PeerInstance, '/peers/<string:id>/')
api.add_resource(DocumentResource, '/documents/')
api.add_resource(DocumentInstance, '/documents/<string:id>/')
{'fraction_non_alphanumeric': 0.12071078431372549, 'fraction_numerical': 0.0030637254901960784, 'mean_word_length': 6.630841121495327, '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': '5484243', 'n_tokens_mistral': 492, 'n_tokens_neox': 477, 'n_words': 131}