<commit_before># Kool

[![CircleCI](https://circleci.com/gh/edasi/kool/tree/master.svg?style=shield)](https://circleci.com/gh/edasi/kool/tree/master)
[![codecov](https://codecov.io/gh/edasi/kool/branch/master/graph/badge.svg)](https://codecov.io/gh/edasi/kool)

Kool is an open source platform for online classroom management. 

The aim is to create a minimalist framework that educationist can extend when building an online classroom management system.

The current version supports extending class User, Course, and Quiz. The database is a small CSV flatfile implementation.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

* Python3. See [Python3 Tutorial](https://docs.python.org/3/tutorial/)
* Virtualenv. See [Virtual Environments Tutorial](https://docs.python.org/3/tutorial/venv.html) 
* Pip. See [Quickstart to installing Python modules](https://pip.pypa.io/en/stable/quickstart/)

### Installing

1. Fetch the latest copy of the project from github

```
git clone https://github.com/edasi/kool.git
```

2. Setup a virtual environment

```
python3 -m venv kool-env
```

On Windows, run:
```
kool-env\Scripts\activate.bat
```

On Unix or MacOS, run:
```
source kool-env/bin/activate
```

3. Install requirements 

```
pip install -U pip
pip install -r requirements.txt
```


### Code Examples

On python interactive shell, start by extending class User to create a Student.

```python
from kool.contrib.auth import User

# Extending class User
class Student(User):
    pass

student = Student(first_name='John', last_name='Doe', email='<EMAIL>', password='<PASSWORD>')

student.save()
```

To insert another student record in an existing table

```python
from kool.db.models import table

# Get Student table to perform CRUD operations
student = table(Student)

student.insert({'first_name': 'Mary', 'last_name': 'Doe', 'email': '<EMAIL>', 'password': '<PASSWORD>'})
```

To query an existing table

```python
from kool.db.models import where

student.filter(where('last_name') == 'Doe')
```

To perform complex queries

```python
from kool.db.flatfile import Query

Student = Query()

student.filter((Student.first_name == 'John') | (Student.first_name == 'Mary'))
```


## Tests

Written tests are inside the tests/ dir. They are implemented using the pytest module. 

On a terminal, run:

```
pytest tests/
```

### Test Coverage

Test coverage is covered by [coverage](https://coverage.readthedocs.io/en/coverage-4.4.1/index.html) and [pytest-cov](https://github.com/pytest-dev/pytest-cov) tools. Local test reports are build in html format inside under htmlcov/dir. However, online test reports are built by [CircleCI](https://circleci.com/gh/edasi/kool/) 


## Related projects

* [Blackboard](http://www.blackboard.com/) 
* [Canvas](https://www.canvaslms.com/)
* [Chamilo](https://chamilo.org/es/)
* [Moodle](https://moodle.org/)
* [OpenEDX](https://github.com/edx/edx-platform)
* [OpenSWAD](https://openswad.org/)
* [Privacy preserving data publishing](https://github.com/rain1/Privacy-Preserving-Data-Publishing)
* [Pygrades](https://bitbucket.org/jjauhien/pygrades)
* [List on Wikipedia](https://en.wikipedia.org/wiki/List_of_learning_management_systems)


## Documentation

Read the latest project documentation at [kool-docs](http://kool-docs.readthedocs.io/en/latest/)


## License

Kool is licensed under [MIT License](https://github.com/edasi/kool/blob/master/LICENSE)
<commit_msg>Added docs badge<commit_after># Kool

[![CircleCI](https://circleci.com/gh/edasi/kool/tree/master.svg?style=shield)](https://circleci.com/gh/edasi/kool/tree/master)
[![codecov](https://codecov.io/gh/edasi/kool/branch/master/graph/badge.svg)](https://codecov.io/gh/edasi/kool)
[![Documentation Status](https://readthedocs.org/projects/kool-docs/badge/?version=latest)](http://kool-docs.readthedocs.io/en/latest/?badge=latest)

Kool is an open source platform for online classroom management. 

The aim is to create a minimalist framework that educationist can extend when building an online classroom management system.

The current version supports extending class User, Course, and Quiz. The database is a small CSV flatfile implementation.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes.

### Prerequisites

* Python3. See [Python3 Tutorial](https://docs.python.org/3/tutorial/)
* Virtualenv. See [Virtual Environments Tutorial](https://docs.python.org/3/tutorial/venv.html) 
* Pip. See [Quickstart to installing Python modules](https://pip.pypa.io/en/stable/quickstart/)

### Installing

1. Fetch the latest copy of the project from github

```
git clone https://github.com/edasi/kool.git
```

2. Setup a virtual environment

```
python3 -m venv kool-env
```

On Windows, run:
```
kool-env\Scripts\activate.bat
```

On Unix or MacOS, run:
```
source kool-env/bin/activate
```

3. Install requirements 

```
pip install -U pip
pip install -r requirements.txt
```


### Code Examples

On python interactive shell, start by extending class User to create a Student.

```python
from kool.contrib.auth import User

# Extending class User
class Student(User):
    pass

student = Student(first_name='John', last_name='Doe', email='<EMAIL>', password='<PASSWORD>')

student.save()
```

To insert another student record in an existing table

```python
from kool.db.models import table

# Get Student table to perform CRUD operations
student = table(Student)

student.insert({'first_name': 'Mary', 'last_name': 'Doe', 'email': '<EMAIL>', 'password': '<PASSWORD>'})
```

To query an existing table

```python
from kool.db.models import where

student.filter(where('last_name') == 'Doe')
```

To perform complex queries

```python
from kool.db.flatfile import Query

Student = Query()

student.filter((Student.first_name == 'John') | (Student.first_name == 'Mary'))
```


## Tests

Written tests are inside the tests/ dir. They are implemented using the pytest module. 

On a terminal, run:

```
pytest tests/
```

### Test Coverage

Test coverage is covered by [coverage](https://coverage.readthedocs.io/en/coverage-4.4.1/index.html) and [pytest-cov](https://github.com/pytest-dev/pytest-cov) tools. Local test reports are build in html format inside under htmlcov/dir. However, online test reports are built by [CircleCI](https://circleci.com/gh/edasi/kool/) 


## Related projects

* [Blackboard](http://www.blackboard.com/) 
* [Canvas](https://www.canvaslms.com/)
* [Chamilo](https://chamilo.org/es/)
* [Moodle](https://moodle.org/)
* [OpenEDX](https://github.com/edx/edx-platform)
* [OpenSWAD](https://openswad.org/)
* [Privacy preserving data publishing](https://github.com/rain1/Privacy-Preserving-Data-Publishing)
* [Pygrades](https://bitbucket.org/jjauhien/pygrades)
* [List on Wikipedia](https://en.wikipedia.org/wiki/List_of_learning_management_systems)


## Documentation

Read the latest project documentation at [kool-docs](http://kool-docs.readthedocs.io/en/latest/)


## License

Kool is licensed under [MIT License](https://github.com/edasi/kool/blob/master/LICENSE)

{'fraction_non_alphanumeric': 0.14533592448639646, 'fraction_numerical': 0.003331482509716824, 'mean_word_length': 4.759392486011191, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, 'https://': 41, 'lorem ipsum': 0, 'www.': 4, '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': '4341039', 'n_tokens_mistral': 2397, 'n_tokens_neox': 2295, 'n_words': 622}