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.5

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.5
File Size Uploaded Provenance
eduskit-0.1.5.tar.gz 14.0 kB With provenance Details

Built distribution (wheel)

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

Total release size: 27.0 kB

Release files / eduskit-0.1.5.tar.gz

Download URL eduskit-0.1.5.tar.gz
Size 14.0 kB
Tags Source
SHA-256 checksum
How to use checksums
645b50e6b13457b382e0a19f3216496b89d55776c8a5f744efce29f408bfc656
BLAKE2b-256 checksum
How to use checksums
3ebb8a5b378756d40f864566b68529c5fefeba0777a2f312194c38f1e68ca871
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 3, 2026.

Transparency log

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

Download URL eduskit-0.1.5-py3-none-any.whl
Size 13.0 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7149fbcb06b3e2aa7efd39aa520e9cc575193d069c01b350d8651a9d4c507eb5
BLAKE2b-256 checksum
How to use checksums
801daefbc2a9c0d2c8c97da2f2afbe1c401c98bed8bc3c38963e759b85862024
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 3, 2026.

Transparency log

Security for eduskit 0.1.5

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.5.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 3, 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