Skip to content
/ kool Public

Kool is a microframework for educators to build an online classroom

License

Notifications You must be signed in to change notification settings

edasi/kool

Repository files navigation

Kool Logo

Kool

CircleCI codecov Documentation Status

Kool is a microframework for educators to build an online classroom.

The current version supports extending users, quizzes, and courses. The default database is a small 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

Installing

To install Kool from PyPI, run:

$ python install kool

If you prefer to install from source, download the latest version from Releases. Thereafter, extract and run:

$ python setup.py install

Code Examples

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

from kool.contrib.auth import User

# Extending class User
class Student(User):
    pass

student = Student(first_name='John', last_name='Doe', email='[email protected]', password='secretpwd')

student.save()

To insert another student record in an existing table

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 protected]', 'password': 'secretpwd2'})

To query an existing table

from kool.db.models import where

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

To perform complex queries

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/ directory. They are implemented using the pytest module.

On a terminal, run:

pytest tests/

Test Coverage

Test coverage is covered by coverage and pytest-cov tools. Local test reports are built in html format inside the htmlcov/ directory that is automatically generated when pytest is run. However, online test reports are built by CircleCI

Related projects

Documentation

Read the latest project documentation at kool-docs

License

Kool is licensed under MIT License