Skip to main content

ModelWhale Python SDK

Project description

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*

Python 版本兼容性

当前支持 Python 3.7 及以上版本。开发时需注意以下限制:

  1. dataclass 装饰器仅支持 Python 3.7+
  2. Union 类型的 | 语法糖仅支持 Python 3.10+,请使用传统写法
  3. 参数分隔符 / 仅支持 Python 3.8+,请避免使用

类型注解说明

根据 PEP 585,Python 的类型注解系统正在经历以下演进:

  1. Python 3.7: 引入 from __future__ import annotations,支持 list[str] 形式的标准库泛型注解
  2. Python 3.9: 默认支持 list[str] 语法,无需 future import
  3. typing 模块中的冗余泛型类型已被弃用
  4. Python 3.14 (预计): 移除 typing 模块中的冗余类型

请在开发时考虑上述变化,合理使用类型注解。

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mw_python_sdk-0.0.62.tar.gz (59.0 kB view details)

Uploaded Source

Built Distribution

mw_python_sdk-0.0.62-py3-none-any.whl (59.2 kB view details)

Uploaded Python 3

File details

Details for the file mw_python_sdk-0.0.62.tar.gz.

File metadata

  • Download URL: mw_python_sdk-0.0.62.tar.gz
  • Upload date:
  • Size: 59.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.11.9

File hashes

Hashes for mw_python_sdk-0.0.62.tar.gz
Algorithm Hash digest
SHA256 992dac54ffdf00d376568082a4df0808993885a96ce1188a52390df86ce8969a
MD5 6e8058f42db28fa5cb39e5366805934c
BLAKE2b-256 0dfe9dc972ee98ecb23f129ace443ffd5ce637af36d955ff2f1912199a6da006

See more details on using hashes here.

File details

Details for the file mw_python_sdk-0.0.62-py3-none-any.whl.

File metadata

File hashes

Hashes for mw_python_sdk-0.0.62-py3-none-any.whl
Algorithm Hash digest
SHA256 65adc5e2914aed0e9f9588d0955d05118283ec0eef98d0e4da0dcf16723d6f76
MD5 77f5dfcd6fb2c5db63fb0d34424ba1f2
BLAKE2b-256 f0c2d4a6c81d4514fd03309a0ee2a1029908b5e33e33d422cb0f8a93b2e220f2

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page