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 工具的大力协助:
- 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.5.0.tar.gz
(15.4 kB
view details)
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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
3df9cd4eb9d6e8d27017942b72ab4c85097cae46b256d8be0ca04f7d257294b7
|
|
| MD5 |
307bbd0ca8e10f9930f2c5f51fa263a1
|
|
| BLAKE2b-256 |
9f1f8b6d20d5d1e1cd24d86e9fdace5911fe4c8fe3ca8fd7e13cd2cef3811e63
|
Provenance
The following attestation bundles were made for popline_py-0.5.0.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.5.0.tar.gz -
Subject digest:
3df9cd4eb9d6e8d27017942b72ab4c85097cae46b256d8be0ca04f7d257294b7 - Sigstore transparency entry: 1552763653
- Sigstore integration time:
-
Permalink:
one18mb/popline-py@ce320aac3c532193fc9922a6aca301fcc9cd0204 -
Branch / Tag:
refs/tags/v0.5.0 - Owner: https://github.com/one18mb
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@ce320aac3c532193fc9922a6aca301fcc9cd0204 -
Trigger Event:
push
-
Statement type: