seerapi-models 1.0.0__tar.gz

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (27) hide show
  1. seerapi_models-1.0.0/LICENSE +21 -0
  2. seerapi_models-1.0.0/PKG-INFO +120 -0
  3. seerapi_models-1.0.0/README.md +77 -0
  4. seerapi_models-1.0.0/pyproject.toml +90 -0
  5. seerapi_models-1.0.0/seerapi_models/__init__.py +244 -0
  6. seerapi_models-1.0.0/seerapi_models/_utils.py +27 -0
  7. seerapi_models-1.0.0/seerapi_models/achievement.py +257 -0
  8. seerapi_models-1.0.0/seerapi_models/battle_effect.py +78 -0
  9. seerapi_models-1.0.0/seerapi_models/build_model/__init__.py +66 -0
  10. seerapi_models-1.0.0/seerapi_models/common.py +406 -0
  11. seerapi_models-1.0.0/seerapi_models/effect.py +119 -0
  12. seerapi_models-1.0.0/seerapi_models/element_type.py +118 -0
  13. seerapi_models-1.0.0/seerapi_models/items/__init__.py +82 -0
  14. seerapi_models-1.0.0/seerapi_models/items/_common.py +95 -0
  15. seerapi_models-1.0.0/seerapi_models/items/enegry_bead.py +93 -0
  16. seerapi_models-1.0.0/seerapi_models/items/equip.py +383 -0
  17. seerapi_models-1.0.0/seerapi_models/items/mintmark_gem.py +267 -0
  18. seerapi_models-1.0.0/seerapi_models/items/skill_activation_item.py +44 -0
  19. seerapi_models-1.0.0/seerapi_models/items/skill_stone.py +150 -0
  20. seerapi_models-1.0.0/seerapi_models/metadata.py +49 -0
  21. seerapi_models-1.0.0/seerapi_models/mintmark.py +448 -0
  22. seerapi_models-1.0.0/seerapi_models/pet/__init__.py +59 -0
  23. seerapi_models-1.0.0/seerapi_models/pet/pet.py +482 -0
  24. seerapi_models-1.0.0/seerapi_models/pet/pet_skin.py +78 -0
  25. seerapi_models-1.0.0/seerapi_models/pet/petbook.py +124 -0
  26. seerapi_models-1.0.0/seerapi_models/pet/soulmark.py +141 -0
  27. seerapi_models-1.0.0/seerapi_models/skill.py +336 -0
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 SeerAPI
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,120 @@
1
+ Metadata-Version: 2.3
2
+ Name: seerapi-models
3
+ Version: 1.0.0
4
+ Summary: SeerAPI 数据模型/ORM 定义
5
+ Keywords: seerapi,models,orm
6
+ Author: Nattsu39
7
+ Author-email: Nattsu39 <Nattsu39@outlook.com>
8
+ License: MIT License
9
+
10
+ Copyright (c) 2025 SeerAPI
11
+
12
+ Permission is hereby granted, free of charge, to any person obtaining a copy
13
+ of this software and associated documentation files (the "Software"), to deal
14
+ in the Software without restriction, including without limitation the rights
15
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
16
+ copies of the Software, and to permit persons to whom the Software is
17
+ furnished to do so, subject to the following conditions:
18
+
19
+ The above copyright notice and this permission notice shall be included in all
20
+ copies or substantial portions of the Software.
21
+
22
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
23
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
24
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
25
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
26
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
27
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
28
+ SOFTWARE.
29
+ Classifier: Operating System :: OS Independent
30
+ Classifier: Development Status :: 4 - Beta
31
+ Classifier: Intended Audience :: Developers
32
+ Classifier: License :: OSI Approved :: MIT License
33
+ Classifier: Programming Language :: Python :: 3.10
34
+ Classifier: Programming Language :: Python :: 3.11
35
+ Classifier: Programming Language :: Python :: 3.12
36
+ Classifier: Programming Language :: Python :: 3.13
37
+ Classifier: Programming Language :: Python :: 3.14
38
+ Requires-Dist: sqlmodel>=0.0.27
39
+ Requires-Python: >=3.10
40
+ Project-URL: Homepage, https://github.com/SeerAPI/seerapi-models
41
+ Project-URL: Repository, https://github.com/SeerAPI/seerapi-models
42
+ Description-Content-Type: text/markdown
43
+
44
+ # seerapi-models
45
+
46
+ SeerAPI 数据模型/ORM 定义,用于前后端开发。
47
+
48
+ ## 安装
49
+ 使用 uv:
50
+
51
+ ```bash
52
+ uv add seerapi-models
53
+ ```
54
+ 或者使用 pip:
55
+
56
+ ```bash
57
+ pip install seerapi-models
58
+ ```
59
+ 也可以使用其他包管理器,如 poetry 等。
60
+ ## 开发环境部署
61
+
62
+ ### 使用 uv 部署
63
+
64
+ 1. **安装 uv**
65
+ ```bash
66
+ # macOS/Linux
67
+ curl -LsSf https://astral.sh/uv/install.sh | sh
68
+
69
+ # Windows
70
+ powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
71
+ ```
72
+
73
+ 2. **克隆项目**
74
+ ```bash
75
+ git clone https://github.com/SeerAPI/seerapi-models.git
76
+ cd seerapi-models
77
+ ```
78
+
79
+ 3. **安装依赖**
80
+ ```bash
81
+ # 同步项目依赖
82
+ uv sync
83
+ ```
84
+
85
+ 4. **运行开发环境**
86
+ ```bash
87
+ # 在项目虚拟环境中运行 Python
88
+ uv run python
89
+
90
+ # 运行测试
91
+ uv run pytest
92
+
93
+ # 运行代码检查
94
+ uv run ruff check
95
+ uv run ruff format
96
+ ```
97
+
98
+ ### 开发容器 (推荐)
99
+
100
+ 项目提供了 Dev Container 配置,支持一键部署开发环境:
101
+
102
+ 1. 使用 VS Code 打开项目
103
+ 2. 安装 Dev Containers 扩展
104
+ 3. 按 `Ctrl+Shift+P` 打开命令面板
105
+ 4. 选择 "Dev Containers: Reopen in Container"
106
+
107
+ 容器会自动安装:
108
+ - Python 3.10
109
+ - uv 包管理器
110
+ - Ruff 代码检查工具
111
+ - 相关 VS Code 扩展
112
+
113
+ ### 环境要求
114
+
115
+ - Python >= 3.10
116
+ - uv >= 0.9.0 (推荐使用最新版)
117
+
118
+ ## 许可证
119
+
120
+ 本项目基于 [MIT License](LICENSE) 开源。
@@ -0,0 +1,77 @@
1
+ # seerapi-models
2
+
3
+ SeerAPI 数据模型/ORM 定义,用于前后端开发。
4
+
5
+ ## 安装
6
+ 使用 uv:
7
+
8
+ ```bash
9
+ uv add seerapi-models
10
+ ```
11
+ 或者使用 pip:
12
+
13
+ ```bash
14
+ pip install seerapi-models
15
+ ```
16
+ 也可以使用其他包管理器,如 poetry 等。
17
+ ## 开发环境部署
18
+
19
+ ### 使用 uv 部署
20
+
21
+ 1. **安装 uv**
22
+ ```bash
23
+ # macOS/Linux
24
+ curl -LsSf https://astral.sh/uv/install.sh | sh
25
+
26
+ # Windows
27
+ powershell -c "irm https://astral.sh/uv/install.ps1 | iex"
28
+ ```
29
+
30
+ 2. **克隆项目**
31
+ ```bash
32
+ git clone https://github.com/SeerAPI/seerapi-models.git
33
+ cd seerapi-models
34
+ ```
35
+
36
+ 3. **安装依赖**
37
+ ```bash
38
+ # 同步项目依赖
39
+ uv sync
40
+ ```
41
+
42
+ 4. **运行开发环境**
43
+ ```bash
44
+ # 在项目虚拟环境中运行 Python
45
+ uv run python
46
+
47
+ # 运行测试
48
+ uv run pytest
49
+
50
+ # 运行代码检查
51
+ uv run ruff check
52
+ uv run ruff format
53
+ ```
54
+
55
+ ### 开发容器 (推荐)
56
+
57
+ 项目提供了 Dev Container 配置,支持一键部署开发环境:
58
+
59
+ 1. 使用 VS Code 打开项目
60
+ 2. 安装 Dev Containers 扩展
61
+ 3. 按 `Ctrl+Shift+P` 打开命令面板
62
+ 4. 选择 "Dev Containers: Reopen in Container"
63
+
64
+ 容器会自动安装:
65
+ - Python 3.10
66
+ - uv 包管理器
67
+ - Ruff 代码检查工具
68
+ - 相关 VS Code 扩展
69
+
70
+ ### 环境要求
71
+
72
+ - Python >= 3.10
73
+ - uv >= 0.9.0 (推荐使用最新版)
74
+
75
+ ## 许可证
76
+
77
+ 本项目基于 [MIT License](LICENSE) 开源。
@@ -0,0 +1,90 @@
1
+ [build-system]
2
+ requires = ["uv_build>=0.8.14,<0.9.0"]
3
+ build-backend = "uv_build"
4
+
5
+ [project]
6
+ name = "seerapi-models"
7
+ version = "1.0.0"
8
+ description = "SeerAPI 数据模型/ORM 定义"
9
+ authors = [{ name = "Nattsu39", email = "Nattsu39@outlook.com" }]
10
+ license = { file = "LICENSE" }
11
+ keywords = ["seerapi", "models", "orm"]
12
+ classifiers = [
13
+ "Operating System :: OS Independent",
14
+ "Development Status :: 4 - Beta",
15
+ "Intended Audience :: Developers",
16
+ "License :: OSI Approved :: MIT License",
17
+ "Programming Language :: Python :: 3.10",
18
+ "Programming Language :: Python :: 3.11",
19
+ "Programming Language :: Python :: 3.12",
20
+ "Programming Language :: Python :: 3.13",
21
+ "Programming Language :: Python :: 3.14",
22
+ ]
23
+ readme = "README.md"
24
+ requires-python = ">=3.10"
25
+ dependencies = [
26
+ "sqlmodel>=0.0.27",
27
+ ]
28
+
29
+ [project.urls]
30
+ Homepage = "https://github.com/SeerAPI/seerapi-models"
31
+ Repository = "https://github.com/SeerAPI/seerapi-models"
32
+
33
+ [tool.uv.build-backend]
34
+ module-root = ""
35
+ module-name = "seerapi_models"
36
+
37
+ [tool.pyright]
38
+ pythonVersion = "3.10"
39
+ pythonPlatform = "All"
40
+ typeCheckingMode = "standard"
41
+ reportShadowedImports = false
42
+ disableBytesTypePromotions = true
43
+
44
+ [tool.ruff]
45
+ line-length = 88
46
+ target-version = "py310"
47
+
48
+ [tool.ruff.format]
49
+ quote-style = "single"
50
+ indent-style = "space"
51
+ line-ending = "lf"
52
+ docstring-code-format = false
53
+
54
+ [tool.ruff.lint]
55
+ select = [
56
+ "F", # Pyflakes
57
+ "W", # pycodestyle warnings
58
+ "E", # pycodestyle errors
59
+ "UP", # pyupgrade
60
+ "ASYNC", # flake8-async
61
+ "C4", # flake8-comprehensions
62
+ "T10", # flake8-debugger
63
+ "T20", # flake8-print
64
+ "PYI", # flake8-pyi
65
+ "PT", # flake8-pytest-style
66
+ "Q", # flake8-quotes
67
+ "I", # isort
68
+ "RUF", # Ruff-specific rules
69
+ ]
70
+ ignore = [
71
+ "Q000", # bad-quotes-inline-string
72
+ "Q001", # bad-quotes-multiline-string
73
+ "Q002", # bad-quotes-docstring
74
+ "Q003", # avoidable-escaped-quote
75
+ "W191", # tab-indentation
76
+ "E402", # module-import-not-at-top-of-file
77
+ "UP037", # quoted-annotation
78
+ "RUF001", # ambiguous-unicode-character-string
79
+ "RUF002", # ambiguous-unicode-character-docstring
80
+ "RUF003", # ambiguous-unicode-character-comment
81
+ ]
82
+
83
+ [tool.ruff.lint.isort]
84
+ force-sort-within-sections = true
85
+ known-first-party = ["solaris", "tests/*"]
86
+ extra-standard-library = ["typing_extensions"]
87
+
88
+ [tool.ruff.lint.flake8-pytest-style]
89
+ fixture-parentheses = false
90
+ mark-parentheses = false
@@ -0,0 +1,244 @@
1
+ from .battle_effect import (
2
+ BattleEffect,
3
+ BattleEffectCategory,
4
+ BattleEffectCategoryORM,
5
+ BattleEffectORM,
6
+ )
7
+ from .effect import (
8
+ PetEffect,
9
+ PetEffectGroup,
10
+ PetEffectGroupORM,
11
+ PetEffectORM,
12
+ VariationEffect,
13
+ VariationEffectORM,
14
+ )
15
+ from .element_type import (
16
+ ElementType,
17
+ ElementTypeORM,
18
+ TypeCombination,
19
+ TypeCombinationORM,
20
+ )
21
+ from .items import (
22
+ EnergyBead,
23
+ EnergyBeadBuffAttrORM,
24
+ EnergyBeadORM,
25
+ Equip,
26
+ EquipBonus,
27
+ EquipBonusAttrORM,
28
+ EquipBonusORM,
29
+ EquipEffectiveOccasion,
30
+ EquipEffectiveOccasionORM,
31
+ EquipORM,
32
+ EquipType,
33
+ EquipTypeORM,
34
+ Gem,
35
+ GemCategory,
36
+ GemCategoryORM,
37
+ GemGen1,
38
+ GemGen1PartORM,
39
+ GemGen2,
40
+ GemGen2PartORM,
41
+ GemGenCategory,
42
+ GemGenCategoryORM,
43
+ GemORM,
44
+ Item,
45
+ ItemORM,
46
+ SkillActivationItem,
47
+ SkillActivationItemORM,
48
+ SkillStone,
49
+ SkillStoneCategory,
50
+ SkillStoneCategoryORM,
51
+ SkillStoneEffect,
52
+ SkillStoneEffectORM,
53
+ SkillStoneORM,
54
+ Suit,
55
+ SuitBonus,
56
+ SuitBonusAttrORM,
57
+ SuitBonusORM,
58
+ SuitORM,
59
+ )
60
+ from .metadata import ApiMetadata, ApiMetadataORM
61
+ from .mintmark import (
62
+ AbilityMintmark,
63
+ AbilityPartORM,
64
+ Mintmark,
65
+ MintmarkBaseAttrORM,
66
+ MintmarkClassCategory,
67
+ MintmarkClassCategoryORM,
68
+ MintmarkExtraAttrORM,
69
+ MintmarkMaxAttrORM,
70
+ MintmarkORM,
71
+ MintmarkRarityCategory,
72
+ MintmarkRarityCategoryORM,
73
+ MintmarkTypeCategory,
74
+ MintmarkTypeCategoryORM,
75
+ SkillMintmark,
76
+ SkillMintmarkEffect,
77
+ SkillPartORM,
78
+ UniversalMintmark,
79
+ UniversalPartORM,
80
+ )
81
+ from .pet import (
82
+ BaseStatORM,
83
+ DiyStatsRangeORM,
84
+ Pet,
85
+ PetArchiveStoryBook,
86
+ PetArchiveStoryBookORM,
87
+ PetArchiveStoryEntry,
88
+ PetArchiveStoryEntryORM,
89
+ PetClass,
90
+ PetClassORM,
91
+ PetEncyclopediaEntry,
92
+ PetEncyclopediaEntryORM,
93
+ PetGenderCategory,
94
+ PetGenderORM,
95
+ PetMountTypeCategory,
96
+ PetMountTypeORM,
97
+ PetORM,
98
+ PetSkin,
99
+ PetSkinCategory,
100
+ PetSkinCategoryORM,
101
+ PetSkinORM,
102
+ PetVipBuffCategory,
103
+ PetVipBuffORM,
104
+ SkillInPet,
105
+ SkillInPetORM,
106
+ Soulmark,
107
+ SoulmarkORM,
108
+ SoulmarkTagCategory,
109
+ SoulmarkTagORM,
110
+ YieldingEvORM,
111
+ )
112
+ from .skill import (
113
+ Skill,
114
+ SkillCategory,
115
+ SkillCategoryORM,
116
+ SkillEffectParam,
117
+ SkillEffectParamInType,
118
+ SkillEffectParamInTypeORM,
119
+ SkillEffectParamORM,
120
+ SkillEffectType,
121
+ SkillEffectTypeORM,
122
+ SkillEffectTypeTag,
123
+ SkillEffectTypeTagORM,
124
+ SkillHideEffect,
125
+ SkillHideEffectORM,
126
+ SkillORM,
127
+ )
128
+
129
+ __all__ = [
130
+ 'AbilityMintmark',
131
+ 'AbilityPartORM',
132
+ 'ApiMetadata',
133
+ 'ApiMetadataORM',
134
+ 'BaseStatORM',
135
+ 'BattleEffect',
136
+ 'BattleEffectCategory',
137
+ 'BattleEffectCategoryORM',
138
+ 'BattleEffectORM',
139
+ 'DiyStatsRangeORM',
140
+ 'ElementType',
141
+ 'ElementTypeORM',
142
+ 'EnergyBead',
143
+ 'EnergyBeadBuffAttrORM',
144
+ 'EnergyBeadORM',
145
+ 'Equip',
146
+ 'EquipBonus',
147
+ 'EquipBonusAttrORM',
148
+ 'EquipBonusORM',
149
+ 'EquipEffectiveOccasion',
150
+ 'EquipEffectiveOccasionORM',
151
+ 'EquipORM',
152
+ 'EquipType',
153
+ 'EquipTypeORM',
154
+ 'Gem',
155
+ 'GemCategory',
156
+ 'GemCategoryORM',
157
+ 'GemGen1',
158
+ 'GemGen1PartORM',
159
+ 'GemGen2',
160
+ 'GemGen2PartORM',
161
+ 'GemGenCategory',
162
+ 'GemGenCategoryORM',
163
+ 'GemORM',
164
+ 'Item',
165
+ 'ItemORM',
166
+ 'Mintmark',
167
+ 'MintmarkBaseAttrORM',
168
+ 'MintmarkClassCategory',
169
+ 'MintmarkClassCategoryORM',
170
+ 'MintmarkExtraAttrORM',
171
+ 'MintmarkMaxAttrORM',
172
+ 'MintmarkORM',
173
+ 'MintmarkRarityCategory',
174
+ 'MintmarkRarityCategoryORM',
175
+ 'MintmarkTypeCategory',
176
+ 'MintmarkTypeCategoryORM',
177
+ 'Pet',
178
+ 'PetArchiveStoryBook',
179
+ 'PetArchiveStoryBookORM',
180
+ 'PetArchiveStoryEntry',
181
+ 'PetArchiveStoryEntryORM',
182
+ 'PetClass',
183
+ 'PetClassORM',
184
+ 'PetEffect',
185
+ 'PetEffectGroup',
186
+ 'PetEffectGroupORM',
187
+ 'PetEffectORM',
188
+ 'PetEncyclopediaEntry',
189
+ 'PetEncyclopediaEntryORM',
190
+ 'PetGenderCategory',
191
+ 'PetGenderORM',
192
+ 'PetMountTypeCategory',
193
+ 'PetMountTypeORM',
194
+ 'PetORM',
195
+ 'PetSkin',
196
+ 'PetSkinCategory',
197
+ 'PetSkinCategoryORM',
198
+ 'PetSkinORM',
199
+ 'PetVipBuffCategory',
200
+ 'PetVipBuffORM',
201
+ 'Skill',
202
+ 'SkillActivationItem',
203
+ 'SkillActivationItemORM',
204
+ 'SkillCategory',
205
+ 'SkillCategoryORM',
206
+ 'SkillEffectParam',
207
+ 'SkillEffectParamInType',
208
+ 'SkillEffectParamInTypeORM',
209
+ 'SkillEffectParamORM',
210
+ 'SkillEffectType',
211
+ 'SkillEffectTypeORM',
212
+ 'SkillEffectTypeTag',
213
+ 'SkillEffectTypeTagORM',
214
+ 'SkillHideEffect',
215
+ 'SkillHideEffectORM',
216
+ 'SkillInPet',
217
+ 'SkillInPetORM',
218
+ 'SkillMintmark',
219
+ 'SkillMintmarkEffect',
220
+ 'SkillORM',
221
+ 'SkillPartORM',
222
+ 'SkillStone',
223
+ 'SkillStoneCategory',
224
+ 'SkillStoneCategoryORM',
225
+ 'SkillStoneEffect',
226
+ 'SkillStoneEffectORM',
227
+ 'SkillStoneORM',
228
+ 'Soulmark',
229
+ 'SoulmarkORM',
230
+ 'SoulmarkTagCategory',
231
+ 'SoulmarkTagORM',
232
+ 'Suit',
233
+ 'SuitBonus',
234
+ 'SuitBonusAttrORM',
235
+ 'SuitBonusORM',
236
+ 'SuitORM',
237
+ 'TypeCombination',
238
+ 'TypeCombinationORM',
239
+ 'UniversalMintmark',
240
+ 'UniversalPartORM',
241
+ 'VariationEffect',
242
+ 'VariationEffectORM',
243
+ 'YieldingEvORM',
244
+ ]
@@ -0,0 +1,27 @@
1
+ def move_to_last(lst: list, index: int) -> None:
2
+ """
3
+ 将列表中指定索引位置的元素移动到列表的最后一位。
4
+
5
+ Args:
6
+ lst: 要操作的列表
7
+ index: 要移动的元素的索引位置
8
+
9
+ """
10
+ if 0 <= index < len(lst):
11
+ # 弹出指定位置的元素并添加到列表末尾
12
+ element = lst.pop(index)
13
+ lst.append(element)
14
+
15
+
16
+ def move_to_first(lst: list, index: int) -> None:
17
+ """
18
+ 将列表中指定索引位置的元素移动到列表的第一位。
19
+
20
+ Args:
21
+ lst: 要操作的列表
22
+ index: 要移动的元素的索引位置
23
+
24
+ """
25
+ if 0 <= index < len(lst):
26
+ element = lst.pop(index)
27
+ lst.insert(0, element)