Skip to main content

Intellif AI-hub SDK.

Project description

Intellif AI-Hub SDK

Intellif AI-Hub 官方 Python 开发包。
一个 Client 对象即可完成数据集管理、标注统计、任务中心等常见操作,无需手写 HTTP 请求。

aihub_sdk/
├─ pyproject.toml
├─ requirements.txt
├─ src/aihub/
│   ├─ client.py
│   ├─ exceptions.py
│   ├─ models/…
│   ├─ services/…
│   └─ utils/…
└─ tests/

💻 安装

# PyPI 安装
pip install intellif-aihub
# 运行环境:Python ≥ 3.9

🚀 快速上手

from aihub import Client

BASE  = "http://192.168.13.160:30021"
TOKEN = "eyJhb..."   # 或设置环境变量:export AI_HUB_TOKEN=...

with Client(base_url=BASE, token=TOKEN) as cli:
    # 1. 同时创建数据集 + 版本(上传本地 ZIP)
    ds_id, ver_id, tag = cli.dataset_management.create_dataset_and_version(
        dataset_name="cats",
        is_local_upload=True,
        local_file_path="/data/cats.zip",
        version_description="first release",
    )
    print("数据集标识:", tag)  # 输出:cats/V1

    # 2. 下载数据集
    cli.dataset_management.run_download(
        dataset_version_name=tag,
        local_dir="/tmp/cats",
        worker=8,
    )

    # 3. 获取标注平台全局统计
    stats = cli.labelfree.get_project_global_stats("cat-project")
    print("总标注数:", stats.global_stats.total_annotations)

🌍 环境变量

变量 作用 默认值
AI_HUB_TOKEN API 鉴权 Token(可不在 Client 中显式传入)

📦 打包 & 发布

项目采用 PEP 517 / pyproject.toml 构建规范。

# 1️⃣ 构建 wheel / sdist
python -m pip install --upgrade build
python -m build                 # 生成 dist/*.whl dist/*.tar.gz

# 2️⃣ 本地验证
pip install --force-reinstall dist/*.whl
python -c "import aihub, sys; print('SDK 版本:', aihub.__version__)"

# 3️⃣ 发布到 PyPI 或私有仓库
python -m pip install --upgrade twine
twine upload dist/*

文档调试:

mkdocs serve

构建文档镜像:

docker build -t 192.168.14.129:80/library/aihub/sdk_doc:latest -f doc.Dockerfile .

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

intellif_aihub-0.1.35.tar.gz (82.1 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

intellif_aihub-0.1.35-py3-none-any.whl (88.8 kB view details)

Uploaded Python 3

File details

Details for the file intellif_aihub-0.1.35.tar.gz.

File metadata

  • Download URL: intellif_aihub-0.1.35.tar.gz
  • Upload date:
  • Size: 82.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.10.12

File hashes

Hashes for intellif_aihub-0.1.35.tar.gz
Algorithm Hash digest
SHA256 d1115e5ec08a71bb5e11ac3726c919a4123f7463aa02ace9b2145384c3572b24
MD5 9843436a2a16e5030f99cfc2ed56b318
BLAKE2b-256 9fc36ba9e4a37da3b9e0dedfb4e17e361050ca02f10e57070cbc220c873d335d

See more details on using hashes here.

File details

Details for the file intellif_aihub-0.1.35-py3-none-any.whl.

File metadata

File hashes

Hashes for intellif_aihub-0.1.35-py3-none-any.whl
Algorithm Hash digest
SHA256 98ff05cafde631d85f037e715a25c1953b9a0f4d4722ab5dfd754cf323b2265a
MD5 e3a691a6c4f63764219000a6b1fe5dfe
BLAKE2b-256 144ec1db9be5e6a89e66d603468a40186cb56edcde2f0064fe460e3b0183bea6

See more details on using hashes here.

Supported by

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