Skip to main content

seerapi-models

SeerAPI 数据模型/ORM 定义,用于前后端开发。

安装

使用 uv:

uv add seerapi-models

或者使用 pip:

pip install seerapi-models

也可以使用其他包管理器,如 poetry 等。

使用

from seerapi_models import Item, ItemORM, ItemCategory, ResourceRef

category_ref = ResourceRef.from_model(ItemCategory, id=1) # 定义物品分类字段引用
item = Item(
    id=1,
    name="Item 1",
    max=100,
    category=catgeory_ref
)

print(item.name)

assert isinstance(item.to_orm(), ItemORM) # 转换为 ORM 模型

开发环境部署

本包是 SeerAPI monorepo 的一部分。推荐从 monorepo 根目录进行开发。

使用 uv 部署

  1. 安装 uv

    # macOS/Linux
    curl -LsSf https://astral.sh/uv/install.sh | sh
    
    # Windows
    powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
    
  2. 克隆 monorepo

    git clone https://github.com/SeerAPI/seerapi.git
    cd seerapi
    
  3. 安装依赖

    # 同步所有工作区依赖
    uv sync
    
  4. 运行开发环境

    # 仅在本包环境中运行
    uv run --package seerapi-models python
    
    # 运行测试
    uv run --package seerapi-models pytest
    
    # 运行代码检查
    uv run ruff check .
    uv run ruff format .
    

开发容器 (推荐)

项目提供了 Dev Container 配置,支持一键部署开发环境:

  1. 使用 VS Code 打开 monorepo 根目录
  2. 安装 Dev Containers 扩展
  3. Ctrl+Shift+P 打开命令面板
  4. 选择 "Dev Containers: Reopen in Container"

容器会自动安装:

  • Python 3.10
  • uv 包管理器
  • pnpm 包管理器
  • Ruff 代码检查工具
  • 相关 VS Code 扩展

环境要求

  • Python >= 3.10
  • uv(推荐使用最新版)

许可证

本项目基于 MIT License 开源。

Download files

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

Source Distribution

seerapi_models-106.6.0.tar.gz (32.9 kB view details)

Uploaded Source

Built Distribution

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

seerapi_models-106.6.0-py3-none-any.whl (53.2 kB view details)

Uploaded Python 3

File details

Details for the file seerapi_models-106.6.0.tar.gz.

File metadata

  • Download URL: seerapi_models-106.6.0.tar.gz
  • Upload date:
  • Size: 32.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for seerapi_models-106.6.0.tar.gz
Algorithm Hash digest
SHA256 7d81c064b20f207ec7039601146195c0b16ef5b1aada26798be45f2538a37c65
MD5 6a8b3ae0e55e9974f2337982b126e6c5
BLAKE2b-256 96b161fce83809c9026f72177d894381134d4c082f969c2c16ec7845318d5010

See more details on using hashes here.

File details

Details for the file seerapi_models-106.6.0-py3-none-any.whl.

File metadata

  • Download URL: seerapi_models-106.6.0-py3-none-any.whl
  • Upload date:
  • Size: 53.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: uv/0.12.1 {"installer":{"name":"uv","version":"0.12.1","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"Ubuntu","version":"24.04","id":"noble","libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":true}

File hashes

Hashes for seerapi_models-106.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 0cda1777b78f048cc3fe73e92c9f84a60fa8ee7c0c66d364f7efa373031a8a14
MD5 8b2436d60e2849c8a019be309f0fa930
BLAKE2b-256 3f6a11db3a61337e201dfefa63ac19c8675ab55247d342044c2c4d2d67f97050

See more details on using hashes here.

Release history Release notifications | RSS feed

106.8.0

2 files

106.7.0

2 files

This release

106.6.0 This release

2 files

106.5.0

2 files

106.4.0

2 files

106.3.0

2 files

106.2.0

2 files

106.1.0

2 files

106.0.0

2 files

105.1.0

2 files

105.0.0

2 files

104.0.0

2 files

103.2.1

2 files

103.2.0

2 files

1.3.2

2 files

1.3.1

2 files

1.3.0

2 files

1.2.2

2 files

1.2.1

2 files

1.2.0

2 files

1.1.0

2 files

1.0.2

2 files

1.0.1

2 files

1.0.0

2 files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page