Skip to main content
Glama

Studizba Analytics

English · Русский

A self-hosted historical collector, analytics engine, dashboard, REST API, and MCP server for public Studizba teacher reviews at BMSTU.

The project preserves source snapshots, tracks revisions instead of overwriting them, calculates confidence-aware teacher and department metrics, and exposes every score together with its evidence and formula metadata.

What it includes

  • adaptive asynchronous collection of departments, teacher cards, and paginated reviews;

  • gzip source snapshots identified by SHA-256;

  • PostgreSQL history for teacher snapshots, review versions, crawl events, and schedules;

  • Russian full-text and trigram search with domain synonym expansion;

  • optional OpenAI-compatible structured review analysis;

  • evidence validation that rejects model quotes absent from the original review;

  • confidence weighting, time decay, Bayesian shrinkage, polarization, and department coverage metrics;

  • FastAPI dashboard and OpenAPI surface;

  • stdio and Streamable HTTP MCP servers;

  • explicit refresh operations and observable background progress.

Related MCP server: OpenReview MCP server

Architecture

Studizba HTML/AJAX
        │
        ▼
async collector ── gzip snapshots ── change journal / adaptive schedule
        │
        ▼
PostgreSQL + pg_trgm + Russian FTS
        │
        ├── optional LLM adapter → validated structured evidence
        ├── statistical aggregation → teacher/department metrics
        ├── FastAPI dashboard and REST API
        └── MCP server

Quick start

Requirements: Python 3.10+, PostgreSQL 16+, and Docker Compose if you want the bundled database service.

git clone https://github.com/ari3lYT/studizba-analytics.git
cd studizba-analytics
cp credentials.example.json credentials.local.json
chmod 600 credentials.local.json
docker compose up -d postgres
python3 -m venv .venv
.venv/bin/pip install -e '.[dev]'
.venv/bin/studizba init-db

Credentials can also be supplied through STUDIZBA_USERNAME, STUDIZBA_PASSWORD, GLM_API_KEY, GLM_MODEL, GLM_BASE_URL, and DATABASE_URL.

Start with a small validation run:

.venv/bin/studizba bootstrap --details-limit 10
.venv/bin/studizba status

Then run a resumable full collection and aggregation:

.venv/bin/studizba bootstrap
.venv/bin/studizba analyze --limit 200 --concurrency 3
.venv/bin/studizba aggregate

The collector backs off after failures and gradually reduces the refresh frequency of unchanged pages. Raw snapshots allow parser and analytics changes to be replayed without requesting the source again.

Services

.venv/bin/studizba serve-dashboard --host 127.0.0.1 --port 8898
STUDIZBA_ROOT="$PWD" .venv/bin/studizba-mcp
STUDIZBA_ROOT="$PWD" .venv/bin/studizba-mcp-http

Example systemd and nginx files live in deploy/. Review paths, users, ports, and access controls before installing them.

MCP capabilities

The MCP surface includes teacher and department search, review search, score explanations, rankings, comparisons, history, recent changes, monitoring status, and explicit refresh operations.

Scores are not returned as unexplained numbers: explain_score includes the formula version, sample size, coverage, confidence, dates, source URLs, and validated evidence spans.

Tests

.venv/bin/pytest -q -m 'not live'

Committed fixtures are small synthetic pages. The repository intentionally contains no copied production reviews, session cookies, account credentials, database dumps, or crawl state. Live tests are isolated behind the live marker.

Responsible use

  • Respect the source site's terms, robots policy, and operational capacity.

  • Keep concurrency low and preserve adaptive delays.

  • Treat reviews as subjective reports, not facts about a person.

  • Do not expose credentials, raw session state, or private data through a public deployment.

  • Use authentication and rate limits before enabling refresh or analysis endpoints for untrusted users.

License

GPL-3.0-or-later. See LICENSE.

Available Tools

18 tools
compare_departmentsC

Compare several departments.

Inputs: department_ids (required), metrics.

compare_teachersC

Compare several teachers on independent metrics.

Inputs: teacher_ids (required), metrics.

explain_scoreB

Explain any teacher metric with confidence, formula and exact evidence spans.

Inputs: metric (required), teacher_id (required), limit.

get_department_analyticsB

Get department metrics including draw risk, variance and coverage.

Inputs: department_id (required).

get_monitoring_statusA

Get crawl, GLM queue, database counts and recent errors.

Inputs: no named parameters.

get_new_reviewsC

Get reviews first observed during a period.

Inputs: days, limit.

get_progressC

Get bootstrap/GLM completion, ETA estimates, throughput, queue health and crawl-run history.

Inputs: hours, bucket_minutes.

get_rating_historyC

Get historical source ratings and review counts.

Inputs: teacher_id (required), days.

get_recent_changesC

Get new/missing/changed entities and rating changes.

Inputs: days, limit.

get_teacher_analyticsC

Get shrinkage-adjusted, time-decayed teacher analytics.

Inputs: teacher_id (required).

get_teacher_profileC

Get source profile, departments, ratings and analytical metrics.

Inputs: teacher_id (required).

get_teacher_reviewsC

Get source reviews for a teacher with dates and Studizba links.

Inputs: teacher_id (required), kind, limit, offset.

rank_departmentsB

Rank departments by quality, ease, cheating environment, variance or draw risk.

Inputs: metric (required), limit, descending, min_confidence.

rank_teachersC

Rank teachers by an analytical metric and confidence threshold.

Inputs: metric (required), limit, descending, department_id, +1 more.

refresh_entityB

Request and immediately perform a live refresh for a department or teacher.

Inputs: entity_id (required), entity_type (required).

search_departmentsC

Find BMSTU departments and subdivisions.

Inputs: query (required), limit.

search_reviewsC

Search review text with Russian full-text matching and typo tolerance, preserving source links.

Inputs: query (required), limit, teacher_id, department_id.

search_teachersA

Find BMSTU teachers by fuzzy full-name search.

Inputs: query (required), limit.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    C2.7/5.0

    Scored across 18 tools

    Disambiguation3/5

    Most tools are clearly separated by search/get/compare/rank intent, but get_progress and get_monitoring_status overlap heavily on crawl and queue status, and get_teacher_profile vs get_teacher_analytics both surface metrics. The descriptions help resolve ambiguity, but a few tool boundaries are fuzzy.

    Naming Consistency4/5

    All tool names follow a lowercase snake_case verb_noun pattern, which is predictable and consistent. Minor inconsistencies exist: some names omit the entity type (e.g., explain_score, get_progress, refresh_entity) and get_rating_history is less scoped than sibling tools, but the overall convention is solid.

    Tool Count3/5

    With 18 tools, the server sits in the 16–25 range that feels heavy for the purpose. The set is not bloated beyond justification, but several monitoring and comparison tools could potentially be consolidated.

    Completeness3/5

    Teacher-level workflows are well covered: search, profile, reviews, analytics, explain, compare, rank, and refresh. However, department-level coverage is thinner—there is no department profile/details tool or direct way to list teachers in a department—so some workflows may hit dead ends.

    Maintenance

    ActivitySlowing
    ResponsivenessNo recent community issues

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      B
      quality
      C
      maintenance
      Enables natural-language, read-only access to a user's own learning-management account for courses, assignments and deadlines, lecture attendance, notices, grades, and syllabus evidence, including reading page/slide/cell locations inside PDF, Office, HWP/HWPX, HTML, and ZIP attachments. Runs locally over stdio or remotely over OAuth-protected Streamable HTTP for desktop and mobile clients, and can compare changes against a locally encrypted baseline.
      19
      MIT
    • A
      license
      B
      quality
      C
      maintenance
      Enables AI assistants to retrieve and compare courses, search and download shared materials, contribute new resources, manage comments, and handle points and transfers.
      51
      MIT