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

Uploaded Source

Built Distribution

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

Uploaded Python 3

File details

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

File metadata

  • Download URL: mw_python_sdk-0.0.61.tar.gz
  • Upload date:
  • Size: 58.9 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.61.tar.gz
Algorithm Hash digest
SHA256 d27fbca6585eca970905a57f820d7d34106adbbcc3558997c7e9f1d05dd83c67
MD5 bed20009c3b6ee10685b07c65b16473d
BLAKE2b-256 8595812307667bf028be2ad80df81fe84698293a04b100da8f68cccdd7ca96c7

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mw_python_sdk-0.0.61-py3-none-any.whl
Algorithm Hash digest
SHA256 fa1202ceef8d415cd813f782da78b98367367d54f1a96068d8981fa127a9de9b
MD5 cf026a4772df417b5e5d33da4fbdd0c4
BLAKE2b-256 cda92acd22c7d4737d32cf505854c76d13002ed7db39e26958c010a1eb05aed2

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