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 工具的大力协助:
- Claude Code(Anthropic)
- DeepSeek(深度求索)
Project details
Release history Release notifications | RSS feed
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)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
76753d2d4f10733024775c05eb0b7c6ab2be4a916f4ee27462dbd6757cb9450b
|
|
| MD5 |
4cd5c85854255362506b848332242cfa
|
|
| BLAKE2b-256 |
26b8cb3566c5e113cccbaac21836692a30a164bc2c75325434452f21c2522304
|
Provenance
The following attestation bundles were made for popline_py-0.4.1.tar.gz:
Publisher:
publish.yml on one18mb/popline-py
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
popline_py-0.4.1.tar.gz -
Subject digest:
76753d2d4f10733024775c05eb0b7c6ab2be4a916f4ee27462dbd6757cb9450b - Sigstore transparency entry: 1534641724
- Sigstore integration time:
-
Permalink:
one18mb/popline-py@3737769f9e3092189b7fdfd019e7c477d026a620 -
Branch / Tag:
refs/tags/v0.4.1 - Owner: https://github.com/one18mb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@3737769f9e3092189b7fdfd019e7c477d026a620 -
Trigger Event:
push
-
Statement type: