etls
English | 中文
表格行列转换:真正的转置,以及「行 / 字典列表」互转。
安装
pip install etls
用法
from etls import dicts_to_rows, rows_to_dicts, transpose
transpose([["a", "b"], ["x", 1], ["y", 2]])
# [['a', 'x', 'y'], ['b', 1, 2]]
rows_to_dicts(["a", "b"], [[1, 2]]) # [{'a': 1, 'b': 2}]
dicts_to_rows(["a", "b"], [{"b": 2, "a": 1}]) # [[1, 2]]
说明
transpose 做真正的行列互换,输入必须是矩形,行宽不一致抛 ValueError。rows_to_dicts 与 dicts_to_rows 互为逆操作,字段顺序按 m_headers 固定,不依赖 dict 的插入顺序;缺键抛 KeyError。
许可证
MIT
English
Reshape tables: a true transpose, plus conversion between rows and dicts.
Install
pip install etls
Usage
from etls import dicts_to_rows, rows_to_dicts, transpose
transpose([["a", "b"], ["x", 1], ["y", 2]])
# [['a', 'x', 'y'], ['b', 1, 2]]
rows_to_dicts(["a", "b"], [[1, 2]]) # [{'a': 1, 'b': 2}]
dicts_to_rows(["a", "b"], [{"b": 2, "a": 1}]) # [[1, 2]]
Notes
transpose swaps rows and columns for real; the grid must be rectangular or ValueError is raised. rows_to_dicts and dicts_to_rows are inverses, with column order following m_headers rather than dict insertion order; a missing key raises KeyError.
License
MIT
Metadata
Release files for etls 0.0.1
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | |
|---|---|---|---|---|
| etls-0.0.1.tar.gz | 3.3 kB | Without provenance | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| etls-0.0.1-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 6.9 kB
Release files / etls-0.0.1.tar.gz
| Download URL | etls-0.0.1.tar.gz |
|---|---|
| Size | 3.3 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6dfe711959649b3d6a3f4af20f7a4572618826e0355c2cb0b6e9c6d35a919ab
|
|
BLAKE2b-256 checksum How to use checksums |
902a33406f546266371bb25e13b592f73aa2bcfaab733fbfc2395d599519c2b9
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / etls-0.0.1-py3-none-any.whl
| Download URL | etls-0.0.1-py3-none-any.whl |
|---|---|
| Size | 3.7 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
3232c339e80f3412b9e774980013b310787f21cf62e81a5cfb54e9b7585d8945
|
|
BLAKE2b-256 checksum How to use checksums |
66ccec04853002a4837a987f2358097cbbffb7bcf36a4dbfdec3f13f263db85f
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for etls 0.0.1
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.