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.63.tar.gz (59.1 kB view details)

Uploaded Source

Built Distribution

mw_python_sdk-0.0.63-py3-none-any.whl (59.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mw_python_sdk-0.0.63.tar.gz
  • Upload date:
  • Size: 59.1 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.63.tar.gz
Algorithm Hash digest
SHA256 6e64e06120f0d056a99756f7d4bd0afd004f0a1cad07a7a49a1ce8ae0166b5f1
MD5 f29982e3a6164ee298368a91cdb3481f
BLAKE2b-256 e64ccb00773a291bb7285b9ce9b2654c831317d49204337a75c21ca8ae58cc03

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mw_python_sdk-0.0.63-py3-none-any.whl
Algorithm Hash digest
SHA256 b7848712ff34fef171c470213e4c2b6e6d8f90ade54fd460beaa36109786527b
MD5 e46856c053a62e827d6c4ae389abf61e
BLAKE2b-256 7525f7f636d97a39e4e8ff738b88704a9bc096f06004e88440fa4fc23dbde4ef

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