Metadata-Version: 2.5
Name: pyetls
Version: 0.0.3
Summary: 按声明式字段映射投影记录，并做显式类型转换。
Project-URL: Homepage, https://pypi.org/project/pyetls/
Author-email: lqxnjk <lqxnjk@qq.com>
License: MIT
License-File: LICENSE
Keywords: coerce,etl,mapping,records,transform
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3 :: Only
Classifier: Topic :: Software Development :: Libraries :: Python Modules
Classifier: Typing :: Typed
Requires-Python: >=3.10
Description-Content-Type: text/markdown

# pyetls

[English](#english) | 中文

按声明式字段映射投影记录，并做显式类型转换。

## 安装

```console
pip install pyetls
```

## 用法

```python
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

---

<a id="english"></a>
## English

Project records through a declared field mapping with explicit type coercion.

## Install

```console
pip install pyetls
```

## Usage

```python
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
