Phi-Save-Codec-Bind-Python
Phi-Save-Codec 的 Python 绑定,用于解析和构建 Phigros 的云端存档格式。
安装
pip install phi_save_codec
使用
from phi_save_codec import PhiSaveCodec, PhiSaveCodecError
# 初始化编解码器
codec = PhiSaveCodec()
# 解析二进制数据
try:
user_data = codec.parse_user(binary_data)
print(user_data)
except PhiSaveCodecError as e:
print(f"解析失败: {e}")
# 构建二进制数据
try:
binary_data = codec.build_user(user_dict)
except PhiSaveCodecError as e:
print(f"构建失败: {e}")
支持的操作
parse_user()/build_user()- 用户数据parse_summary()/build_summary()- 摘要数据parse_game_record()/build_game_record()- 游戏记录parse_game_progress()/build_game_progress()- 游戏进度parse_game_key()/build_game_key()- 游戏密钥parse_settings()/build_settings()- 设置数据
异常处理
所有 API 方法在错误时抛出 PhiSaveCodecError 异常:
try:
data = codec.parse_user(binary_data)
except PhiSaveCodecError as e:
# 获取详细的错误信息
print(f"错误: {e}")
内存管理
该库自动处理与 WASM 模块之间的内存管理,包括:
- 分配和释放内存
- 获取和清空错误信息
- 确保在函数调用前后正确管理临时内存
依赖
msgpack- 数据序列化wasmtime- WASM 运行时支持
Metadata
Release files for phi_save_codec 0.4.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| phi_save_codec-0.4.0.tar.gz | 123.2 kB | Without provenance | Details for phi_save_codec-0.4.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| phi_save_codec-0.4.0-py3-none-any.whl | Python 3 | none | any | Details for phi_save_codec-0.4.0-py3-none-any.whl |
Total release size: 248.8 kB
Release files / phi_save_codec-0.4.0.tar.gz
| Download URL | phi_save_codec-0.4.0.tar.gz |
|---|---|
| Size | 123.2 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
5d27dd4ef9e32d9e9c6393e22cade885266eafe81d307b54dece9e57d7c96f58
|
|
BLAKE2b-256 checksum How to use checksums |
a9f1299716f2b52b0e5ba435ff3a1a7b392c0e145ecbe2bff4b1467cc2861ee4
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.26.9 CPython/3.14.0 Windows/11
|
Release files / phi_save_codec-0.4.0-py3-none-any.whl
| Download URL | phi_save_codec-0.4.0-py3-none-any.whl |
|---|---|
| Size | 125.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
ac4556f047e3a32e72ee1a94d065eb6b2ff466155c71521007885af640ddd587
|
|
BLAKE2b-256 checksum How to use checksums |
6a0ae1963c689b63ea1373ec311db9fe219d0e6a6f84de970ca3ebf9de435497
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
pdm/2.26.9 CPython/3.14.0 Windows/11
|
Security for phi_save_codec 0.4.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.