Skip to main content

lxj

English | 中文

把行数据渲染成对齐的纯文本表格。

安装

pip install lxj

用法

from lxj import render_table

print(render_table(["name", "n"], [["a", 1], ["beta", 22]]))
# name  n
# ----  --
# a     1
# beta  22

print(render_table(["n"], [["1"], ["22"]], n_align="right"))

说明

列宽按字符数计算(宽字符仍算一列),行尾空格会剪掉。列数不齐、对齐方式数量不符、对齐值非法,都抛 ValueError——缺一格是数据问题,不是排版偏好。

许可证

MIT


English

Render rows as an aligned plain-text table.

Install

pip install lxj

Usage

from lxj import render_table

print(render_table(["name", "n"], [["a", 1], ["beta", 22]]))
# name  n
# ----  --
# a     1
# beta  22

print(render_table(["n"], [["1"], ["22"]], n_align="right"))

Notes

Column widths are measured in characters and trailing spaces are trimmed. Ragged rows, a mismatched alignment list and an unknown alignment all raise ValueError.

License

MIT

Metadata

Release files for lxj 0.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for lxj 0.0.3
File Size Uploaded Provenance Actions
lxj-0.0.3.tar.gz 3.6 kB Without provenance Details for lxj-0.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for lxj 0.0.3
File Interpreter ABI Platform Actions
lxj-0.0.3-py3-none-any.whl Python 3 none any Details for lxj-0.0.3-py3-none-any.whl

Total release size: 7.3 kB

Release files / lxj-0.0.3.tar.gz

Download URL lxj-0.0.3.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
0186fcdb20f524716fd42099bc3ef0b0d43fb676f5c841b123521b465be6f0fe
BLAKE2b-256 checksum
How to use checksums
ecfd3ab1093f7d406351235b6b42cb1bf29c5f3895fc23d2a9b27d48dedeef69
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Release files / lxj-0.0.3-py3-none-any.whl

Download URL lxj-0.0.3-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
e9cc703ae5f5e53cfd879beb4eb04a30b937ad87556590ee177cd6ae02954093
BLAKE2b-256 checksum
How to use checksums
eb885102bd72203c70cf2b8c1883e781c829c56e71268db0f4dbacd0cd7e3c9e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.10.11

Security for lxj 0.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page