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 开源。

Metadata

Release files for seerapi-models 106.12.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for seerapi-models 106.12.0
File Size Uploaded Provenance Actions
seerapi_models-106.12.0.tar.gz 37.5 kB Without provenance Details for seerapi_models-106.12.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for seerapi-models 106.12.0
File Interpreter ABI Platform Actions
seerapi_models-106.12.0-py3-none-any.whl Python 3 none any Details for seerapi_models-106.12.0-py3-none-any.whl

Total release size: 98.8 kB

Release files / seerapi_models-106.12.0.tar.gz

Download URL seerapi_models-106.12.0.tar.gz
Size 37.5 kB
Tags Source
SHA-256 checksum
How to use checksums
3ab110e2cd54803f654c6a6f95da734f7d9bfed747e14e5fbb0534a426c02f07
BLAKE2b-256 checksum
How to use checksums
77c9782fe463a133e37640f7fca909b5fca45bf423723c728b3680b2006d6d21
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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}

Release files / seerapi_models-106.12.0-py3-none-any.whl

Download URL seerapi_models-106.12.0-py3-none-any.whl
Size 61.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
558e3e1841f05b29ca30a5aa5a3180f82a3c9106eb25b4ca4c777c64084f0966
BLAKE2b-256 checksum
How to use checksums
2b6d9a35153dd960c120e183b873ad49ec738654873ff9386911dd543022a3e0
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via uv/0.13.4 {"installer":{"name":"uv","version":"0.13.4","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}

Security for seerapi-models 106.12.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

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