Skip to main content

eduskit

Python B 端 Server SDK。sdk.client 调课堂 server-api,sdk.whiteboard_client 调白板 server-api。

方法名为 snake_case;请求/响应 JSON 字段仍为 camelCase(originId、eduUserId)。

概念与方法表见 docs/overview.md、docs/api.md。

安装

pip install -e .

要求 Python 3.9+,无第三方运行时依赖(标准库 urllib)。

PYTHONPATH=. python3 -m unittest tests.test_eduskit -v

初始化

from eduskit import Eduskit, EduskitError

sdk = Eduskit(
    timeout_ms=10_000,
    lang="zh-CN",
    client={
        "base_url": "http://localhost:3112",
        "app_id": "app_edu",
        "app_key": "edu_key",
        "app_secret": "edu_secret",
    },
    whiteboard_client={
        "base_url": "http://localhost:3012",
        "app_id": "app_wb",
        "app_key": "wb_key",
        "app_secret": "wb_secret",
    },
)

配置字典键是 snake_case(base_url / app_id / app_key / app_secret)。两侧均可选。

课堂 sdk.client

user = sdk.client.users.register(
    originId="stu_001",
    nickname="小明",
    avatar="https://example.com/a.png",
)
token = sdk.client.auth.issue_token(eduUserId=user["eduUserId"], originId="stu_001")
classroom = sdk.client.classrooms.create(
    name="一年级数学",
    startsAt="2026-08-17T10:00:00.000Z",
    endsAt="2026-08-17T11:00:00.000Z",
    teacherEduUserId=user["eduUserId"],
)
sdk.client.classrooms.start(classroom["classroomId"])
sdk.client.classrooms.members.add(
    classroom["classroomId"],
    eduUserId=user["eduUserId"],
    role="student",
)
sdk.client.classrooms.members.replace_students(
    classroom["classroomId"],
    eduUserIds=[user["eduUserId"]],
)
sdk.client.classrooms.permissions.set(
    classroom["classroomId"],
    user["eduUserId"],
    permission="camera",
    effect="grant",
    operatorEduUserId=user["eduUserId"],
)
sdk.client.classrooms.coursewares.bind(
    classroom["classroomId"],
    coursewareIds=["cw_xxx"],
)
sdk.client.app.get_ui_config()
方法 对应 Node
users.register(**input) users.register
auth.issue_token(**input) auth.issueToken
classrooms.create/start/end 同名
classrooms.members.add/list 同名
classrooms.members.replace_students replaceStudents
classrooms.permissions.get/set/clear 同名
classrooms.coursewares.list/bind/unbind 同名
app.get_ui_config / set_ui_config getUiConfig / setUiConfig

白板 sdk.whiteboard_client

credential = sdk.whiteboard_client.auth.issue_room_token(
    roomId="room_1",
    userId=user["eduUserId"],
    role="host",
    expiresIn=3600,
)
session = sdk.whiteboard_client.recordings.start("room_1", externalRef="lesson_001")
sdk.whiteboard_client.recordings.stop("room_1", recordingId=session["recordingId"])
sdk.whiteboard_client.recordings.enqueue_video_export(session["recordingId"], profile="hd")
sdk.whiteboard_client.files.convert(sourceUrl="https://cdn.example.com/lesson.pptx")
方法 对应 Node
auth.issue_room_token issueRoomToken
recordings.start/stop/list/get 同名
recordings.register_media_asset / delete_media_asset camelCase 版
recordings.enqueue_video_export / get_video_export camelCase 版
captures.create/list 同名
files.convert / get_convert_job getConvertJob

错误

try:
    sdk.client.auth.issue_token(eduUserId="")
except EduskitError as e:
    print(e.error_code, e.status, e.trace_id, e.source)

sdk.client.last_trace_id / sdk.whiteboard_client.last_trace_id。

示例

Metadata

Release files for eduskit 0.1.4

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for eduskit 0.1.4
File Size Uploaded Provenance
eduskit-0.1.4.tar.gz 13.0 kB With provenance Details

Built distribution (wheel)

Table of built distributions (wheels) for eduskit 0.1.4
File Interpreter ABI Platform
eduskit-0.1.4-py3-none-any.whl Python 3 none any Details

Total release size: 25.6 kB

Release files / eduskit-0.1.4.tar.gz

Download URL eduskit-0.1.4.tar.gz
Size 13.0 kB
Tags Source
SHA-256 checksum
How to use checksums
d17c7f4ac1d144979cdb24df51aa398c45f59c6c028796b3fcf9a203e5c4059f
BLAKE2b-256 checksum
How to use checksums
62891ff63a495a3b56c2f6c2624a64e10889ea07e167e2bc9cc274e5b7f44304
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Release files / eduskit-0.1.4-py3-none-any.whl

Download URL eduskit-0.1.4-py3-none-any.whl
Size 12.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
558506c4efd289606f511fcbf148565fc08ae861dfb4766855080d9e99f6e6df
BLAKE2b-256 checksum
How to use checksums
979ab91bbb4309442fd6af531a23b3c1824b81889d4648b7d45916275de9446b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.14

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

Security for eduskit 0.1.4

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

All 2 files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for eduskit-0.1.4.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 1, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page