<commit_before># OpenSpending

## Developer installation

Install the application and copy configuration templates.

    $ pip install -E pyenv -e .
    $ source pyenv/bin/activate
    $ cp development.ini_tmpl development.ini
    $ cp test.ini_tmpl test.ini

Create a database if you do not have one already. We recommend using Postgres
but you can use anything compatible with SQLAlchemy. For postgres you would do::

    createdb -E utf-8 --owner {your-database-user} openspending

You will also need to install python bindings for your database. For example,
for Postgresql you will want to install the psycopg2 library::

    pip install psycopg2
    # or on debian / ubuntu
    # apt-get install python-psycopg2

Configure the database connection. For Postgres, add a full db url of
the form:

    openspending.db.url = postgresql://{user}:{pass}@localhost/openspending

Initialize the database

    $ ostool development.ini db init

Generate the help system documentation (this is used by the front-end
and must be available, developer documents are separate). The output 
will be copied to the web applications template directory.

    $ cd help; make clean html

Run the tests

    $ nosetests

Run the application

    $ paster serve --reload development.ini

## Issue tracking

Please report bugs and submit feature requests at https://github.com/okfn/openspending/issues.<commit_msg>document solr setup. <commit_after># OpenSpending

## Developer installation

Install the application and copy configuration templates.

    $ pip install -E pyenv -e .
    $ source pyenv/bin/activate
    $ cp development.ini_tmpl development.ini
    $ cp test.ini_tmpl test.ini

Create a database if you do not have one already. We recommend using Postgres
but you can use anything compatible with SQLAlchemy. For postgres you would do::

    createdb -E utf-8 --owner {your-database-user} openspending

You will also need to install python bindings for your database. For example,
for Postgresql you will want to install the psycopg2 library::

    pip install psycopg2
    # or on debian / ubuntu
    # apt-get install python-psycopg2

Further, you will need to set up Apache Solr. You can download the
latest version from the project website and then replace the default
schema with the one from OpenSpending.::

    $ cp -R apache-solr-X.X.X/example/solr/* ./solr
    $ ln -sf "../wdmmg_schema.xml" ./solr/conf/schema.xml

And then start solr (maybe inside a 'screen')::

    $ cd solr; java -jar start.jar

After setting up Solr, you must reference the server from the
configuration file::

    # Configure your Solr url. This is a typical default:
    openspending.solr.url = http://localhost:8983/solr

Configure the database connection. For Postgres, add a full db url of
the form:

    openspending.db.url = postgresql://{user}:{pass}@localhost/openspending

Initialize the database

    $ ostool development.ini db init

Generate the help system documentation (this is used by the front-end
and must be available, developer documents are separate). The output 
will be copied to the web applications template directory.

    $ cd help; make clean html

Run the tests

    $ nosetests

Run the application

    $ paster serve --reload development.ini

## Issue tracking

Please report bugs and submit feature requests at https://github.com/okfn/openspending/issues.
{'fraction_non_alphanumeric': 0.06498516320474777, 'fraction_numerical': 0.0035608308605341245, 'mean_word_length': 3.5739484396200814, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 2, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 3, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '553960', 'n_tokens_mistral': 937, 'n_tokens_neox': 901, 'n_words': 417}