Skip to content

docs(examples): add Python client and usage examples - #702

Open
FenjuFu wants to merge 1 commit into
iflytek:mainfrom
FenjuFu:feat/python-examples
Open

docs(examples): add Python client and usage examples#702
FenjuFu wants to merge 1 commit into
iflytek:mainfrom
FenjuFu:feat/python-examples

Conversation

@FenjuFu

@FenjuFu FenjuFu commented Aug 11, 2026

Copy link
Copy Markdown
Member

Summary

  • What changed? Adds examples/python/ — a dependency-light (requests-only) SkillHubClient plus runnable examples covering search → resolve → download → publish (and star/rate) against the REST API — and links it from the README Documentation sections (EN + ZH).
  • Why is this needed? A real sample of recent stargazers skews heavily Python (~481) vs Java (~77), a mismatch with SkillHub's Java backend. There is currently no Python on-ramp, so Python-leaning visitors have no code-level way in. This gives them one and doubles as a reference SDK seed.

Addresses #701 (which also proposes evaluating a full published pip SDK as a follow-up).

What's included

  • skillhub_client.pySkillHubClient wrapping public + authenticated + CLI-compat endpoints; unwraps the {code,msg,data} envelope and raises SkillHubError on non-zero codes.
  • example_usage.py — runnable: python example_usage.py (search/inspect/download) and python example_usage.py publish <zip> <namespace>.
  • README.md — setup, quick start, endpoint coverage table.
  • requirements.txt — just requests.

Endpoints are taken from document/docs/04-developer/api (public.md / authenticated.md / cli-compat.md).

Validation

  • Backend tests passed
  • Frontend typecheck/build passed
  • OpenAPI SDK regenerated or checked when API contracts changed
  • Smoke test run when relevant

Examples/docs only — no backend, API, or build surface changed. Locally verified python -m py_compile on both modules and an offline smoke test (client construction, Bearer/X-Request-Id headers, SKILLHUB_URL env resolution, rate() score validation) all pass. Live end-to-end calls were not run here (no running instance), but every endpoint maps to the documented API.

Risk

  • User-facing impact: new examples/ directory + two README bullets; nothing existing changed.
  • Deployment or migration impact: none.
  • Rollback approach: revert the commit.

Notes

Add examples/python: a dependency-light (requests-only) SkillHubClient plus
runnable examples covering search, resolve, download and publish against the
REST API, and link them from the README Documentation sections. Serves the
large Python-leaning audience and doubles as a reference SDK seed (see iflytek#701).

Signed-off-by: FenjuFu <fufenjupku@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant