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.4

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.4
File Size Uploaded Provenance Actions
lxj-0.0.4.tar.gz 3.6 kB Without provenance Details for lxj-0.0.4.tar.gz

Built distribution (wheel)

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

Total release size: 7.3 kB

Release files / lxj-0.0.4.tar.gz

Download URL lxj-0.0.4.tar.gz
Size 3.6 kB
Tags Source
SHA-256 checksum
How to use checksums
b31f11bfb8dfa0c4951db978b85aa2e3829105ad7b291cb4565313ee41764807
BLAKE2b-256 checksum
How to use checksums
1c24980fe60c6d3630e3b6b3c0040e55d3766e0c3f26b89004bd5643f9166c53
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.4-py3-none-any.whl

Download URL lxj-0.0.4-py3-none-any.whl
Size 3.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
88e07334deca2359c0cb49691a64039cd2ce06dcbf5e244eb0976b37dd413244
BLAKE2b-256 checksum
How to use checksums
766a12a5a8f2fea833f1caa2e114bdd3a92dd16cea0669eaa3038bd17a44d788
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.4

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