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

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.2
File Size Uploaded Provenance
eduskit-0.1.2.tar.gz 12.8 kB With provenance Details

Built distribution (wheel)

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

Total release size: 25.3 kB

Release files / eduskit-0.1.2.tar.gz

Download URL eduskit-0.1.2.tar.gz
Size 12.8 kB
Tags Source
SHA-256 checksum
How to use checksums
cfffb161dad7decca163dfa24a92f4b12a151a6b24b257538a4ebe1600a78ed2
BLAKE2b-256 checksum
How to use checksums
167ae5528c7923b990c54429f4ad3b557a43a1c81345806b1c399b53cab668f9
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 Sep 22, 2026.

Transparency log

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

Download URL eduskit-0.1.2-py3-none-any.whl
Size 12.5 kB
Tags Python 3
SHA-256 checksum
How to use checksums
9e01cb60f2eabb343626691415fc2d944e43278c4888ac5af4aad44333a8f769
BLAKE2b-256 checksum
How to use checksums
51e4f2261f8166d00ddf01725b5a73b0d9969f89055c390fac87872bb4b293fb
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 Sep 22, 2026.

Transparency log

Security for eduskit 0.1.2

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.2.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 Sep 22, 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