<commit_before>oclapi
======

Source for the Open Concept Lab APIs

## Local Environment Setup (on a Mac)

Follow this [guide](http://docs.python-guide.org/en/latest/starting/install/osx/) to install Python 2.7
and set up a virtual environment.  You may wish to name your virtual environment something more descriptive,
for example replace:

    virtualenv venv

With:

    virtualenv ocl

And then run:

    source ocl/bin/activate

### Mongo

The OCL API uses MongoDB as its backend datastore.  If you don't have it already, use Homebrew to install it:

    brew install mongodb

Once installed, use the `mongod` command to start a local instance of the MongoDB server.
Then, in a separate console window, run `mongo` to start the interactive command-line client.
Using the Mongo command-line, create a database named `ocl`:

     > use ocl

### Solr

Solr is used to support searching across OCL API entities.  You can use Homebrew to install it as well:

    brew install solr

*** More details required here ***

### The Django Project

Clone this repository, and `cd` into the `django/ocl` directory.
Before you can run the server, you will need to execute the following steps:

1. Install the project dependencies:

    pip install -r requirements.txt

2. Create a Django `Site` and make note of its ID:

    ./manage.py shell
    \>\>\> from django.contrib.sites.models import Site
    \>\>\> s = Site()
    \>\>\> s.save()
    \>\>\> \[Ctrl-D\] (to exit)
    <commit_msg>More formatting<commit_after>oclapi
======

Source for the Open Concept Lab APIs

## Local Environment Setup (on a Mac)

Follow this [guide](http://docs.python-guide.org/en/latest/starting/install/osx/) to install Python 2.7
and set up a virtual environment.  You may wish to name your virtual environment something more descriptive,
for example replace:

    virtualenv venv

With:

    virtualenv ocl

And then run:

    source ocl/bin/activate

### Mongo

The OCL API uses MongoDB as its backend datastore.  If you don't have it already, use Homebrew to install it:

    brew install mongodb

Once installed, use the `mongod` command to start a local instance of the MongoDB server.
Then, in a separate console window, run `mongo` to start the interactive command-line client.
Using the Mongo command-line, create a database named `ocl`:

     > use ocl

### Solr

Solr is used to support searching across OCL API entities.  You can use Homebrew to install it as well:

    brew install solr

*** More details required here ***

### The Django Project

Clone this repository, and `cd` into the `django/ocl` directory.
Before you can run the server, you will need to execute the following steps:

1. Install the project dependencies:

    pip install -r requirements.txt

2. Create a Django `Site` and make note of its ID:

    ./manage.py shell
    \>\>\> from django.contrib.sites.models import Site
    \>\>\> s = Site()
    \>\>\> s.save()
    \>\>\> \[Ctrl-D\] (to exit)

This should end the code block.
    
{'fraction_non_alphanumeric': 0.08981636060100166, 'fraction_numerical': 0.002671118530884808, 'mean_word_length': 3.3294797687861273, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 29, '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': '7159524', 'n_tokens_mistral': 906, 'n_tokens_neox': 834, 'n_words': 407}