obstruct 0.2.11__tar.gz → 0.2.13__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.
- {obstruct-0.2.11 → obstruct-0.2.13}/.idea/workspace.xml +30 -7
- {obstruct-0.2.11 → obstruct-0.2.13}/PKG-INFO +7 -5
- {obstruct-0.2.11 → obstruct-0.2.13}/README.md +5 -3
- {obstruct-0.2.11 → obstruct-0.2.13}/pyproject.toml +9 -1
- obstruct-0.2.13/src/obstruct/__init__.py +19 -0
- obstruct-0.2.13/src/obstruct/__version__.py +1 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/struct_type.py +1 -0
- obstruct-0.2.11/src/obstruct/__init__.py +0 -4
- obstruct-0.2.11/src/obstruct/__version__.py +0 -1
- {obstruct-0.2.11 → obstruct-0.2.13}/.idea/.gitignore +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/.idea/inspectionProfiles/Project_Default.xml +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/.idea/inspectionProfiles/profiles_settings.xml +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/.idea/misc.xml +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/.idea/modules.xml +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/.idea/obstruct.iml +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/.idea/vcs.xml +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/aot/__init__.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/aot/aot.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/aot/base.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/aot/pack.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/aot/unpack.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/metadata_marks.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/methods.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/types/__init__.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/types/base.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/types/types.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/src/obstruct/types/types.pyi +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/test/test.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/test/test_speed.py +0 -0
- {obstruct-0.2.11 → obstruct-0.2.13}/uv.lock +0 -0
|
@@ -4,11 +4,7 @@
|
|
|
4
4
|
<option name="autoReloadType" value="SELECTIVE" />
|
|
5
5
|
</component>
|
|
6
6
|
<component name="ChangeListManager">
|
|
7
|
-
<list default="true" id="b482b6b4-48ce-4be1-bf3c-a72ec254fa35" name="更改" comment="
|
|
8
|
-
<change afterPath="$PROJECT_DIR$/src/obstruct/metadata_marks.py" afterDir="false" />
|
|
9
|
-
<change beforePath="$PROJECT_DIR$/src/obstruct/__version__.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/obstruct/__version__.py" afterDir="false" />
|
|
10
|
-
<change beforePath="$PROJECT_DIR$/src/obstruct/struct_type.py" beforeDir="false" afterPath="$PROJECT_DIR$/src/obstruct/struct_type.py" afterDir="false" />
|
|
11
|
-
</list>
|
|
7
|
+
<list default="true" id="b482b6b4-48ce-4be1-bf3c-a72ec254fa35" name="更改" comment="chore: 更新项目信息和 README 文档" />
|
|
12
8
|
<option name="SHOW_DIALOG" value="false" />
|
|
13
9
|
<option name="HIGHLIGHT_CONFLICTS" value="true" />
|
|
14
10
|
<option name="HIGHLIGHT_NON_ACTIVE_CHANGELIST" value="false" />
|
|
@@ -232,7 +228,31 @@
|
|
|
232
228
|
<option name="project" value="LOCAL" />
|
|
233
229
|
<updated>1786966736535</updated>
|
|
234
230
|
</task>
|
|
235
|
-
<
|
|
231
|
+
<task id="LOCAL-00013" summary="feat: 更新版本号(跳过一次版本号更改),添加 NOT_A_FIELD 标记控制一个字段是否该被当作二进制字段解析">
|
|
232
|
+
<option name="closed" value="true" />
|
|
233
|
+
<created>1786968425494</created>
|
|
234
|
+
<option name="number" value="00013" />
|
|
235
|
+
<option name="presentableId" value="LOCAL-00013" />
|
|
236
|
+
<option name="project" value="LOCAL" />
|
|
237
|
+
<updated>1786968425494</updated>
|
|
238
|
+
</task>
|
|
239
|
+
<task id="LOCAL-00014" summary="feat: 更新版本号,添加一些更加清晰明确的类型别名">
|
|
240
|
+
<option name="closed" value="true" />
|
|
241
|
+
<created>1786969304874</created>
|
|
242
|
+
<option name="number" value="00014" />
|
|
243
|
+
<option name="presentableId" value="LOCAL-00014" />
|
|
244
|
+
<option name="project" value="LOCAL" />
|
|
245
|
+
<updated>1786969304874</updated>
|
|
246
|
+
</task>
|
|
247
|
+
<task id="LOCAL-00015" summary="chore: 更新项目信息和 README 文档">
|
|
248
|
+
<option name="closed" value="true" />
|
|
249
|
+
<created>1786969506672</created>
|
|
250
|
+
<option name="number" value="00015" />
|
|
251
|
+
<option name="presentableId" value="LOCAL-00015" />
|
|
252
|
+
<option name="project" value="LOCAL" />
|
|
253
|
+
<updated>1786969506672</updated>
|
|
254
|
+
</task>
|
|
255
|
+
<option name="localTasksCounter" value="16" />
|
|
236
256
|
<servers />
|
|
237
257
|
</component>
|
|
238
258
|
<component name="TypeScriptGeneratedFilesManager">
|
|
@@ -262,6 +282,9 @@
|
|
|
262
282
|
<MESSAGE value="修复:unpack.py 中没有移除的调试逻辑 更新版本号至 0.2.8" />
|
|
263
283
|
<MESSAGE value="chore: 移除 test_speed.py 中的调试逻辑" />
|
|
264
284
|
<MESSAGE value="fix: 修复 slots 的生成逻辑" />
|
|
265
|
-
<
|
|
285
|
+
<MESSAGE value="feat: 更新版本号(跳过一次版本号更改),添加 NOT_A_FIELD 标记控制一个字段是否该被当作二进制字段解析" />
|
|
286
|
+
<MESSAGE value="feat: 更新版本号,添加一些更加清晰明确的类型别名" />
|
|
287
|
+
<MESSAGE value="chore: 更新项目信息和 README 文档" />
|
|
288
|
+
<option name="LAST_COMMIT_MESSAGE" value="chore: 更新项目信息和 README 文档" />
|
|
266
289
|
</component>
|
|
267
290
|
</project>
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
Metadata-Version: 2.5
|
|
2
2
|
Name: obstruct
|
|
3
|
-
Version: 0.2.
|
|
3
|
+
Version: 0.2.13
|
|
4
4
|
Author-email: LittleNightSong <LittleNightSongYO@outlook.com>
|
|
5
5
|
Classifier: Development Status :: 3 - Alpha
|
|
6
6
|
Classifier: Programming Language :: Python
|
|
7
|
-
Classifier: Programming Language :: Python :: 3.11
|
|
8
7
|
Classifier: Programming Language :: Python :: 3.12
|
|
9
8
|
Classifier: Programming Language :: Python :: 3.13
|
|
9
|
+
Classifier: Programming Language :: Python :: 3.14
|
|
10
10
|
Classifier: Programming Language :: Python :: Implementation :: CPython
|
|
11
11
|
Classifier: Programming Language :: Python :: Implementation :: PyPy
|
|
12
12
|
Requires-Python: >=3.12
|
|
@@ -16,7 +16,7 @@ _来自已弃坑的 `Hydrogenlib`,重拾起当初的决心_
|
|
|
16
16
|
|
|
17
17
|
|
|
18
18
|
> [!TIP]
|
|
19
|
-
> 这个项目来自 [`HydrogenLib`](https://github.com/LittleNightSong/HydrogenLib)的 `Objective-Struct`
|
|
19
|
+
> 这个项目来自 [`HydrogenLib`](https://github.com/LittleNightSong/HydrogenLib)的 `Objective-Struct` 模块,是一个脱离大项目的版本
|
|
20
20
|
>
|
|
21
21
|
> 同时,`HydrogenLib`中的 `Objective-Struct` 不再会更新
|
|
22
22
|
|
|
@@ -36,7 +36,7 @@ _一个简单、纯粹、极速的二进制解析库_
|
|
|
36
36
|
- 完整的操作支持(打包、解包、流式处理)
|
|
37
37
|
|
|
38
38
|
> [!WARNING]
|
|
39
|
-
|
|
39
|
+
> 使用 `array` 类型时,建议不要传入 list 类型或其它 Python 序列,
|
|
40
40
|
> 可能会带来极大的性能影响
|
|
41
41
|
|
|
42
42
|
## 基准测试
|
|
@@ -67,7 +67,6 @@ import obstruct as obs
|
|
|
67
67
|
from dataclasses import dataclass
|
|
68
68
|
|
|
69
69
|
|
|
70
|
-
@obs.struct()
|
|
71
70
|
@dataclass()
|
|
72
71
|
class MyStruct(obs.Struct):
|
|
73
72
|
a: int
|
|
@@ -89,6 +88,9 @@ if __name__ == '__main__':
|
|
|
89
88
|
|
|
90
89
|
```
|
|
91
90
|
|
|
91
|
+
> [!WARNING]
|
|
92
|
+
> 不要在 dataclass 装饰器中使用 `slots=True`,`Struct` 元类已为类型添加了 `__slots__`
|
|
93
|
+
|
|
92
94
|
在上述示例中,你可能发现 `data != restored`,这是浮点数的精度限制导致的。 因此,我们不建议使用浮点数类型,浮点数在二进制传输中也不常见。
|
|
93
95
|
|
|
94
96
|
## 计划
|
|
@@ -2,7 +2,7 @@ _来自已弃坑的 `Hydrogenlib`,重拾起当初的决心_
|
|
|
2
2
|
|
|
3
3
|
|
|
4
4
|
> [!TIP]
|
|
5
|
-
> 这个项目来自 [`HydrogenLib`](https://github.com/LittleNightSong/HydrogenLib)的 `Objective-Struct`
|
|
5
|
+
> 这个项目来自 [`HydrogenLib`](https://github.com/LittleNightSong/HydrogenLib)的 `Objective-Struct` 模块,是一个脱离大项目的版本
|
|
6
6
|
>
|
|
7
7
|
> 同时,`HydrogenLib`中的 `Objective-Struct` 不再会更新
|
|
8
8
|
|
|
@@ -22,7 +22,7 @@ _一个简单、纯粹、极速的二进制解析库_
|
|
|
22
22
|
- 完整的操作支持(打包、解包、流式处理)
|
|
23
23
|
|
|
24
24
|
> [!WARNING]
|
|
25
|
-
|
|
25
|
+
> 使用 `array` 类型时,建议不要传入 list 类型或其它 Python 序列,
|
|
26
26
|
> 可能会带来极大的性能影响
|
|
27
27
|
|
|
28
28
|
## 基准测试
|
|
@@ -53,7 +53,6 @@ import obstruct as obs
|
|
|
53
53
|
from dataclasses import dataclass
|
|
54
54
|
|
|
55
55
|
|
|
56
|
-
@obs.struct()
|
|
57
56
|
@dataclass()
|
|
58
57
|
class MyStruct(obs.Struct):
|
|
59
58
|
a: int
|
|
@@ -75,6 +74,9 @@ if __name__ == '__main__':
|
|
|
75
74
|
|
|
76
75
|
```
|
|
77
76
|
|
|
77
|
+
> [!WARNING]
|
|
78
|
+
> 不要在 dataclass 装饰器中使用 `slots=True`,`Struct` 元类已为类型添加了 `__slots__`
|
|
79
|
+
|
|
78
80
|
在上述示例中,你可能发现 `data != restored`,这是浮点数的精度限制导致的。 因此,我们不建议使用浮点数类型,浮点数在二进制传输中也不常见。
|
|
79
81
|
|
|
80
82
|
## 计划
|
|
@@ -9,7 +9,15 @@ description = ''
|
|
|
9
9
|
readme = "README.md"
|
|
10
10
|
requires-python = ">=3.12"
|
|
11
11
|
keywords = []
|
|
12
|
-
classifiers = [
|
|
12
|
+
classifiers = [
|
|
13
|
+
"Development Status :: 3 - Alpha",
|
|
14
|
+
"Programming Language :: Python",
|
|
15
|
+
"Programming Language :: Python :: 3.12",
|
|
16
|
+
"Programming Language :: Python :: 3.13",
|
|
17
|
+
"Programming Language :: Python :: 3.14",
|
|
18
|
+
"Programming Language :: Python :: Implementation :: CPython",
|
|
19
|
+
"Programming Language :: Python :: Implementation :: PyPy"
|
|
20
|
+
]
|
|
13
21
|
dependencies = []
|
|
14
22
|
|
|
15
23
|
[[project.authors]]
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
from .methods import pack, unpack
|
|
2
|
+
from .struct_type import Struct
|
|
3
|
+
from .types import *
|
|
4
|
+
from .metadata_marks import Marks
|
|
5
|
+
|
|
6
|
+
# 定义一些清晰的类型别名
|
|
7
|
+
|
|
8
|
+
byte = signed_char
|
|
9
|
+
ubyte = unsigned_char
|
|
10
|
+
|
|
11
|
+
i8 = signed_char
|
|
12
|
+
i16 = short
|
|
13
|
+
i32 = int
|
|
14
|
+
i64 = long
|
|
15
|
+
|
|
16
|
+
u8 = unsigned_char
|
|
17
|
+
u16 = unsigned_short
|
|
18
|
+
u32 = unsigned_int
|
|
19
|
+
u64 = unsigned_long
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
version = "0.2.13"
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
version = "0.2.11"
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|