Skip to main content

A client for interacting with the Ed LMS

Project description

ed-api-client

A Python client for the Ed LMS API, with utilities for analysing student workspace activity.

Installation

pip install ed-api-client

Quick start

from ed_api_client import EdClient

client = EdClient(token="your-api-token")

# Retrieve all students in a course
users = client.get_users(course_id=12345, role="student")

# Retrieve the module/lesson structure
modules = client.get_module_structure(course_id=12345)
for module in modules:
    for lesson in module.lessons:
        print(lesson.title)

# Fetch and analyse a student's workspace activity
log = client.get_workspace_log(workspace_id="abc123")
files = client.get_scaffold_files(challenge_id=99)
summary = WorkspaceSummary.from_log(files, log)

print(summary.total_active_time)
for file_id, file in summary.file_summaries.items():
    print(file.path, file.pasted_proportion, file.cursor_entropy)

Full API reference: https://dmilne.gitlab.io/ed-api-client

Development

Prerequisites

Install Poetry via Homebrew:

brew install poetry

Setup

Clone the repository and install all dependencies (including dev dependencies):

git clone https://gitlab.com/dmilne/ed-api-client.git
cd ed-api-client
poetry install --with dev

Running tests

poetry run pytest tests/ -v

Tests use the responses library to mock HTTP calls — no real Ed credentials are needed.

Viewing the docs locally

poetry run mkdocs serve

Then open http://localhost:8000.

Publishing a new version

  1. Bump the version:

    poetry version patch   # or: minor, major
    
  2. Configure your PyPI token (first time only):

    poetry config pypi-token.pypi your-token-here
    

    Get a token at https://pypi.org/manage/account/token/.

  3. Build and publish:

    poetry publish --build
    

CI/CD

The GitLab pipeline (.gitlab-ci.yml) runs on every push:

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

ed_api_client-0.1.5.tar.gz (24.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ed_api_client-0.1.5-py3-none-any.whl (29.3 kB view details)

Uploaded Python 3

File details

Details for the file ed_api_client-0.1.5.tar.gz.

File metadata

  • Download URL: ed_api_client-0.1.5.tar.gz
  • Upload date:
  • Size: 24.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.4 Darwin/24.6.0

File hashes

Hashes for ed_api_client-0.1.5.tar.gz
Algorithm Hash digest
SHA256 44e9a7f93f9e72ebab26c130f82f44e45832af54c2252879294b7264c9124feb
MD5 b3ad0a142d50cbc12e72b796cde61734
BLAKE2b-256 91c77b41bdd7f98d73f6f2aa4c43ee9fecb2a6f5ca35c75368a74c4bdbc942f1

See more details on using hashes here.

File details

Details for the file ed_api_client-0.1.5-py3-none-any.whl.

File metadata

  • Download URL: ed_api_client-0.1.5-py3-none-any.whl
  • Upload date:
  • Size: 29.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/2.4.1 CPython/3.14.4 Darwin/24.6.0

File hashes

Hashes for ed_api_client-0.1.5-py3-none-any.whl
Algorithm Hash digest
SHA256 9ff6ab277e3d69d78b67aff24a42957a89141a2d6531becf42899bc1b8e7ff9e
MD5 3dbb595f4ce3540ed6fa0486f2f7a491
BLAKE2b-256 44820694685aa7bc6afcd548bf0f9a00f0c60333f50645d7a21738d748a83236

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page