mw-sdk-python
简介
mw-sdk-python 是一个用于与 Heywhale 平台交互的 Python SDK,提供了简单易用的接口来管理和获取数据集。
安装方式
pip install mw-sdk-python
快速开始
下面是一个简单示例,展示如何使用 SDK 根据数据集ID下载数据集:
from mw_python_sdk import download_dir
download_dir("66b08ec9898e74a8232bb2d1")
配置说明
SDK 支持以下环境变量配置:
MW_TOKEN: 身份验证令牌。若代码中未直接提供 token 参数,将使用此环境变量的值HEYWHALE_HOST: Heywhale 平台地址(可选),默认为https://www.heywhale.com
开发指南
本地开发安装
# 基础安装
pip install -e .
# 安装 LLM 相关功能(可选)
pip install -e '.[llm]'
发布打包
以 0.1.0 版本为例:
python -m build
python -m twine upload dist/mw_python_sdk-0.1.0*
可以用一些uv或者其他的包管理工具来上传,这里只是一个示例,因为llm子模块的一些依赖支持不到Python3.7, 而Python又没有分子模块的版本支持的功能,所以没有用包管理工具,这里面其实llm子模块要求python大于3.8。
API 文档
Python 版本兼容性
当前支持 Python 3.7 及以上版本。开发时需注意以下限制:
dataclass装饰器仅支持 Python 3.7+- Union 类型的
|语法糖仅支持 Python 3.10+,请使用传统写法 - 参数分隔符
/仅支持 Python 3.8+,请避免使用
类型注解说明
根据 PEP 585,Python 的类型注解系统正在经历以下演进:
- Python 3.7: 引入
from __future__ import annotations,支持list[str]形式的标准库泛型注解 - Python 3.9: 默认支持
list[str]语法,无需 future import - typing 模块中的冗余泛型类型已被弃用
- Python 3.14 (预计): 移除 typing 模块中的冗余类型
请在开发时考虑上述变化,合理使用类型注解。
Metadata
Release files for mw-python-sdk 0.0.93
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| mw_python_sdk-0.0.93.tar.gz | 74.6 kB | Without provenance | Details for mw_python_sdk-0.0.93.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| mw_python_sdk-0.0.93-py3-none-any.whl | Python 3 | none | any | Details for mw_python_sdk-0.0.93-py3-none-any.whl |
Total release size: 153.5 kB
Release files / mw_python_sdk-0.0.93.tar.gz
| Download URL | mw_python_sdk-0.0.93.tar.gz |
|---|---|
| Size | 74.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
f81318c9d9c2f310a497bbe33d6865e302e4baf4ce5e7f8c252f86bbad94b099
|
|
BLAKE2b-256 checksum How to use checksums |
5c7fd5921ddcc93f7839ad95a70db333020ca5442f974aa2e9c8c2e4c808f137
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.13
|
Release files / mw_python_sdk-0.0.93-py3-none-any.whl
| Download URL | mw_python_sdk-0.0.93-py3-none-any.whl |
|---|---|
| Size | 79.0 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
07bbfe58675561612ca886bd3388802cb11620226c27bbe049c0e6d07f18556d
|
|
BLAKE2b-256 checksum How to use checksums |
649da7d0e60bf69bb6a6e340d42a1f9b4c658930cd86f31b72425cbf017a9d6c
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.1.0 CPython/3.10.13
|
Security for mw-python-sdk 0.0.93
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.
No provenance found
None of the files in this release were uploaded with provenance metadata.
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.
To learn more about protecting yourself from malicious actors, visit our package security documentation.