Skip to main content

Phigros Cloud Save Codec Library

Project description

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 运行时支持

Project details


Download files

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

Source Distribution

phi_save_codec-0.2.3.tar.gz (114.3 kB view details)

Uploaded Source

Built Distribution

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

phi_save_codec-0.2.3-py3-none-any.whl (115.1 kB view details)

Uploaded Python 3

File details

Details for the file phi_save_codec-0.2.3.tar.gz.

File metadata

  • Download URL: phi_save_codec-0.2.3.tar.gz
  • Upload date:
  • Size: 114.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.23.1 CPython/3.13.2 Windows/11

File hashes

Hashes for phi_save_codec-0.2.3.tar.gz
Algorithm Hash digest
SHA256 efdf0b967d8200cf41c3c51200782a29fa148e5a377c009ac39cc99b1b260544
MD5 c0326ce13a0f5d1e26b5327fb7f748ae
BLAKE2b-256 d74e89a3557ec5670fb46c713fcfa492ef879120129c675be8d68670025e49f3

See more details on using hashes here.

File details

Details for the file phi_save_codec-0.2.3-py3-none-any.whl.

File metadata

  • Download URL: phi_save_codec-0.2.3-py3-none-any.whl
  • Upload date:
  • Size: 115.1 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: pdm/2.23.1 CPython/3.13.2 Windows/11

File hashes

Hashes for phi_save_codec-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 5aa9fd757f5e8e8ad4508aab1a8b5b1bd1d8bae9f173e5d651ccd1b5fb7e02f4
MD5 b66cc7745ded8af4a4f19f7564fa4000
BLAKE2b-256 a13242efa487c32a5a9449b63342d41e7d83879436031c32d08421982b374458

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page