Skip to main content

PopLine — Line-oriented serialization format (C extension)

Project description

PopLine Python

PopLine 序列化格式的 Python C 扩展实现。零外部依赖。

v0.4.0: 解析改用 SAX 接口(pln_sax_parse)直接构建 Python 对象,序列化使用 C 核心生成器 API,均无中间 pln_value_t DOM。

安装

pip install popline-py

使用

import pln

# PopLine → Python 对象(SAX 解析,零 DOM)
obj = pln.loads('{\nkey: "value"\n')
# → {"key": "value"}

# Python 对象 → PopLine(生成器 API,不经过中间 DOM)
text = pln.dumps({"key": "value"})
# → '{\nkey: "value"\n'

性能

测试数据:package.json(17011 B)→ package.pln(13076 B,76.9%),5000 次迭代

操作 Python json pln
解析 701 ms (140 µs/op) 623 ms (125 µs/op) 0.89x
序列化 943 ms (189 µs/op) 237 ms (47 µs/op) 0.25x

测试

python test.py

致谢

本项目的开发得到了以下 AI 工具的大力协助:

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

popline_py-0.4.1.tar.gz (15.4 kB view details)

Uploaded Source

File details

Details for the file popline_py-0.4.1.tar.gz.

File metadata

  • Download URL: popline_py-0.4.1.tar.gz
  • Upload date:
  • Size: 15.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for popline_py-0.4.1.tar.gz
Algorithm Hash digest
SHA256 76753d2d4f10733024775c05eb0b7c6ab2be4a916f4ee27462dbd6757cb9450b
MD5 4cd5c85854255362506b848332242cfa
BLAKE2b-256 26b8cb3566c5e113cccbaac21836692a30a164bc2c75325434452f21c2522304

See more details on using hashes here.

Provenance

The following attestation bundles were made for popline_py-0.4.1.tar.gz:

Publisher: publish.yml on one18mb/popline-py

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

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