<commit_before># Lookit-api

This is the codebase for Experimenter and Lookit.  Experimenter is a platform for designing and administering research studies, meant for researchers. The Lookit platform is participant-facing, where users can signup and take part in studies. It is built using Django, PostgreSQL, and Ember.js (see Ember portion of codebase, [ ember-lookit-frameplayer](https://github.com/CenterForOpenScience/ember-lookit-frameplayer)), and is developed by the [Center for Open Science](https://cos.io/).

## Getting Started
### Prerequisites
- Make sure you have python 3.6: `$ python --version`.  If you don't have this, install from https://www.python.org/.
- Make sure you have `pip`. `$ pip --version`
- Create a virtual environment with python 3.6
  - One way to do this:
  - `$  pip install virtualenv`
  - `$ virtualenv -p python3 envname`, *where `envname` is the name of your virtual environment.*
  - `$ source envname/bin/activate` *Activates your virtual environment*
- Install postgres
  - make sure you have brew `$ brew`
  - `$ brew install postgresql`
  - `$ brew services start postgres` *Starts up postgres*
  - `$ createdb lookit` *Creates lookit database*

### Installation
- `$ git clone https://github.com/CenterForOpenScience/lookit-api.git`
- `$ cd lookit-api`
- `$ sh up.sh` *Installs dependencies and run migrations*
-  `$ python manage.py createsuperuser` *Creates superuser locally (has all user permissions)*
- `$ python manage.py runserver` *Starts up server*

## Useful features

### Creating feedback
To add feedback to a response via the API, you must have "can_edit_study"
permissions for the associated study.

POST /api/v1/feedback/
```json
{
 "data": {
   "attributes": {
     "comment": "<add your comment here>"
   },
   "relationships": {
     "response": {
       "data": {
         "type": "responses",
         "id": "<response_id>"
       }
     }
   },
   "type": "feedback"
 }
}
```
<commit_msg>Remove extra space.<commit_after># Lookit-api

This is the codebase for Experimenter and Lookit.  Experimenter is a platform for designing and administering research studies, meant for researchers. The Lookit platform is participant-facing, where users can signup and take part in studies. It is built using Django, PostgreSQL, and Ember.js (see Ember portion of codebase, [ ember-lookit-frameplayer](https://github.com/CenterForOpenScience/ember-lookit-frameplayer)), and is developed by the [Center for Open Science](https://cos.io/).

## Getting Started
### Prerequisites
- Make sure you have python 3.6: `$ python --version`.  If you don't have this, install from https://www.python.org/.
- Make sure you have `pip`. `$ pip --version`
- Create a virtual environment with python 3.6
  - One way to do this:
  - `$  pip install virtualenv`
  - `$ virtualenv -p python3 envname`, *where `envname` is the name of your virtual environment.*
  - `$ source envname/bin/activate` *Activates your virtual environment*
- Install postgres
  - make sure you have brew `$ brew`
  - `$ brew install postgresql`
  - `$ brew services start postgres` *Starts up postgres*
  - `$ createdb lookit` *Creates lookit database*

### Installation
- `$ git clone https://github.com/CenterForOpenScience/lookit-api.git`
- `$ cd lookit-api`
- `$ sh up.sh` *Installs dependencies and run migrations*
- `$ python manage.py createsuperuser` *Creates superuser locally (has all user permissions)*
- `$ python manage.py runserver` *Starts up server*

## Useful features

### Creating feedback
To add feedback to a response via the API, you must have "can_edit_study"
permissions for the associated study.

POST /api/v1/feedback/
```json
{
 "data": {
   "attributes": {
     "comment": "<add your comment here>"
   },
   "relationships": {
     "response": {
       "data": {
         "type": "responses",
         "id": "<response_id>"
       }
     }
   },
   "type": "feedback"
 }
}
```

{'fraction_non_alphanumeric': 0.12177687005361246, 'fraction_numerical': 0.0030635690579525147, 'mean_word_length': 3.603995299647474, 'pattern_counts': {'":': 18, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 8, 'lorem ipsum': 0, 'www.': 2, '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': '6998980', 'n_tokens_mistral': 1202, 'n_tokens_neox': 1163, 'n_words': 428}