<commit_before>oclapi
======

Source for the Open Concept Lab APIs

## Docker Environment Setup (preferred)

Fork the repo on github and clone your fork:
````sh
git clone https://github.com/{youruser}/oclapi
````

Add a remote repo to upstream in order to be able to fetch updates:
````sh
git remote add upstream https://github.com/OpenConceptLab/oclapi
````


Go to:
````sh
cd oclapi/django-nonrel/ocl
````

Fire up containers:
````sh
docker-compose up
````

Open up [http://0.0.0.0:8000/admin/authtoken/token/](http://0.0.0.0:8000/admin/authtoken/token/) in a browser and login with username 'root' and password '<PASSWORD>'. Note down
the key, which you will need later to access REST resources.

Note that when using the docker quickstart on Windows, you need to check docker machine IP and replace 0.0.0.0 with the actual IP address. Run:
````sh
docker-machine ip
````

## Manual Environment Setup (on a Mac)

Follow this [guide](http://docs.python-guide.org/en/latest/starting/install/osx/) to install Python 2.7<commit_msg>Added running commands example<commit_after>oclapi
======

Source for the Open Concept Lab APIs

## Docker Environment Setup (preferred)

Fork the repo on github and clone your fork:
````sh
git clone https://github.com/{youruser}/oclapi
````

Add a remote repo to upstream in order to be able to fetch updates:
````sh
git remote add upstream https://github.com/OpenConceptLab/oclapi
````


Go to:
````sh
cd oclapi/django-nonrel/ocl
````

Fire up containers:
````sh
docker-compose up
````

Open up [http://0.0.0.0:8000/admin/authtoken/token/](http://0.0.0.0:8000/admin/authtoken/token/) in a browser and login with username 'root' and password 'Root<PASSWORD>'. Note down
the key, which you will need later to access REST resources.

Note that when using the docker quickstart on Windows, you need to check docker machine IP and replace 0.0.0.0 with the actual IP address. Run:
````sh
docker-machine ip
````

### Running commands in a container

You can run any command in a container. Open up a new terminal and run for example:
````sh
docker-compose run ocl python manage.py syncdb
````
, where OCL is the service name.
On Windows run this instead:
````sh
docker exec -it ocl_ocl_1 python manage.py syncdb
````
, where ocl_ocl_1 is a container ID, which is printed out when starting docker-compose up.

## Manual Environment Setup (on a Mac)

Follow this [guide](http://docs.python-guide.org/en/latest/starting/install/osx/) to install Python 2.7
{'fraction_non_alphanumeric': 0.124343964473153, 'fraction_numerical': 0.018570851836899476, 'mean_word_length': 4.3062098501070665, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 4, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 6, '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': '7068861', 'n_tokens_mistral': 834, 'n_tokens_neox': 744, 'n_words': 312}