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

Uploaded Source

Built Distribution

mw_python_sdk-0.0.60-py3-none-any.whl (59.1 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: mw_python_sdk-0.0.60.tar.gz
  • Upload date:
  • Size: 58.8 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.60.tar.gz
Algorithm Hash digest
SHA256 af3e9ec8aa589c2a2aa33558107a700d7929e2aec7c2acef1b6b4d62fbd043c8
MD5 22aacc269fe82a6fbc0a444f89193f4c
BLAKE2b-256 a129f5e40fa3a8668d4b8098477bbc74705e5c769fbce681cb6a170175affc01

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for mw_python_sdk-0.0.60-py3-none-any.whl
Algorithm Hash digest
SHA256 c0e101c39064fc0cfa6967499462b6fe3dbc3ff35a77d7e25e51d10ca14121ea
MD5 54daf76550066cb120d26c5df88aad58
BLAKE2b-256 e4aa8cbd4352c0debd47855b06307f15e1d8b98e53cc01570c65d058584e7120

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