pyetls
English | 中文
按声明式字段映射投影记录,并做显式类型转换。
安装
pip install pyetls
用法
from pyetls import project
rows = [{"id": "7", "amount": "3.5"}]
mapping = {"code": ("id", int), "total": ("amount", float)}
project(rows, mapping)
# [{'code': 7, 'total': 3.5}]
说明
映射写成 {新字段: 旧字段} 或 {新字段: (旧字段, 类型)},类型只认 str/int/float/bool;源字段缺失或转换失败抛 CoerceError 并带上字段名——不静默补 None,因为那会把脏数据藏到下游。
许可证
MIT
English
Project records through a declared field mapping with explicit type coercion.
Install
pip install pyetls
Usage
from pyetls import project
rows = [{"id": "7", "amount": "3.5"}]
mapping = {"code": ("id", int), "total": ("amount", float)}
project(rows, mapping)
# [{'code': 7, 'total': 3.5}]
Notes
A mapping is {new: old} or {new: (old, type)} with str/int/float/bool. A missing source field or a failed conversion raises CoerceError naming the field — nothing is silently filled with None.
License
MIT
Metadata
Release files for pyetls 0.0.3
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 | Actions |
|---|---|---|---|---|
| pyetls-0.0.3.tar.gz | 3.5 kB | Without provenance | Details for pyetls-0.0.3.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| pyetls-0.0.3-py3-none-any.whl | Python 3 | none | any | Details for pyetls-0.0.3-py3-none-any.whl |
Total release size: 7.3 kB
Release files / pyetls-0.0.3.tar.gz
| Download URL | pyetls-0.0.3.tar.gz |
|---|---|
| Size | 3.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
1f5b5a28b801b761ef8ee3d1ccef1903ab69f0e8af7d3de4268c6581c96f4338
|
|
BLAKE2b-256 checksum How to use checksums |
85bd9c91301c50e6d62477e7f650b7d914564a2d07f28bde30477be0ec817e58
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Release files / pyetls-0.0.3-py3-none-any.whl
| Download URL | pyetls-0.0.3-py3-none-any.whl |
|---|---|
| Size | 3.9 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
06eca4583a87554dd14fc17e6fcc58d495d468d74971df4a4cd1652d25607d2e
|
|
BLAKE2b-256 checksum How to use checksums |
5ca8e022106d8781c8d4acad7c9e2511d55fe52037dd78ad3572acb1fc39b5d6
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.10.11
|
Security for pyetls 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.