The Docker-based Open edX distribution designed for peace of mind
npx @tessl/cli install tessl/pypi-tutor@20.0.0The Docker-based Open edX distribution designed for peace of mind. Tutor is the official Open edX distribution that simplifies deployment, customization, upgrading, and scaling of Open edX platforms through complete Docker containerization and extensible plugin architecture.
pip install tutortutorimport tutorFor working with configuration:
from tutor import config
from tutor.types import Config, ConfigValueFor plugin development:
from tutor import hooks
from tutor.plugins import base
from tutor.core.hooks import Action, Filter, ContextFor environment and template rendering:
from tutor import env
from tutor.env import JinjaEnvironment, RendererFor CLI and task execution:
from tutor.commands.context import Context, BaseTaskContext
from tutor.tasks import BaseTaskRunner, BaseComposeTaskRunnerFor utilities and formatting:
from tutor import utils, fmt
from tutor.exceptions import TutorError# Initialize and launch Open edX platform locally
tutor local launch
# Configure the platform
tutor config save --interactive
# Install and enable plugins
tutor plugins install discovery
tutor plugins enable discovery
# Run in development mode
tutor dev launch
# Deploy to Kubernetes
tutor k8s launchfrom tutor import config
from tutor.commands.context import Context
# Load configuration
context = Context("/path/to/tutor/root")
config_data = config.load(context.root)
# Update configuration
config_data["PLATFORM_NAME"] = "My Open edX Platform"
config.save_config_file(context.root, config_data)Tutor's architecture enables flexible Open edX deployment across multiple environments:
This design provides a unified interface for Open edX deployment while supporting extensive customization through plugins and configuration templates.
Complete CLI for Open edX deployment and management with commands for local development, production deployment, configuration management, plugin administration, and image building.
def main() -> None: ...
class TutorCli(click.Group): ...
def cli(context: click.Context, root: str, show_help: bool) -> None: ...Centralized configuration system with support for defaults, user overrides, environment variables, and interactive setup.
def load(root: str) -> Config: ...
def load_defaults() -> Config: ...
def load_minimal(root: str) -> Config: ...
def save(context: Context, **kwargs) -> None: ...Event-driven plugin architecture enabling extensibility through Actions, Filters, and Contexts for lifecycle management and data transformation.
class Action[T]:
def add(self, priority: int = None) -> Callable: ...
def do(self, *args, **kwargs) -> None: ...
class Filter[T1, T2]:
def add(self, priority: int = None) -> Callable: ...
def apply(self, value: T1, *args, **kwargs) -> T2: ...Template rendering system using Jinja2 for generating Docker Compose configurations, Kubernetes manifests, and application settings.
def render_file(config: Config, *path: str) -> str: ...
def save_file(root: str, filename: str, content: str) -> None: ...Abstract task runner framework supporting different deployment contexts (Local, Dev, Kubernetes) with Docker Compose integration.
class BaseTaskRunner:
def run_task(self, service: str, command: str) -> int: ...
def render(self, *path: str) -> str: ...Core utilities for encryption, file operations, string processing, bind mount management, YAML serialization, and type definitions for configuration management.
ConfigValue = Union[str, float, None, bool, List[str], List[Any], Dict[str, Any], Dict[Any, Any]]
Config = Dict[str, ConfigValue]
def encrypt(text: str) -> str: ...
def random_string(length: int) -> str: ...
def parse_mount(value: str) -> list[tuple[str, str, str]]: ...
def load(stream: Union[str, IO[str]]) -> Any: ...# Standard library imports for type annotations
from typing import Union, Dict, List, Any, Optional, Callable, IO, Iterator, Iterable
from _io import TextIOWrapper
import click
# Core configuration types
ConfigValue = Union[str, float, None, bool, List[str], List[Any], Dict[str, Any], Dict[Any, Any]]
Config = Dict[str, ConfigValue]
# Context type for CLI operations
class Context:
def __init__(self, root: str): ...
@property
def root(self) -> str: ...
class BaseTaskContext(Context):
def job_runner(self, config: Config) -> BaseTaskRunner: ...
# Base exception
class TutorError(Exception): ...
# Task runner base classes
class BaseTaskRunner:
def __init__(self, root: str, config: Config): ...
def run_task(self, service: str, command: str) -> int: ...
class BaseComposeTaskRunner(BaseTaskRunner):
def docker_compose(self, *command: str) -> int: ...
# Environment classes
class JinjaEnvironment:
def read_str(self, template_name: str) -> str: ...
def read_bytes(self, template_name: str) -> bytes: ...
class Renderer:
def __init__(self, config: Optional[Config] = None): ...
def render_str(self, text: str) -> str: ...
def render_template(self, template_name: str) -> Union[str, bytes]: ...