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'

性能

测试数据:test.json(17011 B)→ test.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.5.0.tar.gz (15.4 kB view details)

Uploaded Source

File details

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

File metadata

  • Download URL: popline_py-0.5.0.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.5.0.tar.gz
Algorithm Hash digest
SHA256 3df9cd4eb9d6e8d27017942b72ab4c85097cae46b256d8be0ca04f7d257294b7
MD5 307bbd0ca8e10f9930f2c5f51fa263a1
BLAKE2b-256 9f1f8b6d20d5d1e1cd24d86e9fdace5911fe4c8fe3ca8fd7e13cd2cef3811e63

See more details on using hashes here.

Provenance

The following attestation bundles were made for popline_py-0.5.0.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