Metadata-Version: 2.4
Name: ce_img_ll
Version: 0.4.0
Summary: Insert WPS in-cell images into XLSX by editing OOXML parts
Author: Zeaulo
License-Expression: MIT
Project-URL: Homepage, https://github.com/Zeaulo
Project-URL: Repository, https://github.com/Zeaulo/ce_img_ll
Project-URL: Issues, https://github.com/Zeaulo/ce_img_ll/issues
Project-URL: Author, https://github.com/Zeaulo
Keywords: xlsx,wps,spreadsheet,ooxml,image
Classifier: Development Status :: 3 - Alpha
Classifier: Intended Audience :: Developers
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Topic :: Software Development :: Libraries
Requires-Python: >=3.10
Description-Content-Type: text/markdown
License-File: LICENSE
Dynamic: license-file

﻿# ce_img_ll

## 中文说明

`ce_img_ll` 通过修改 XLSX 底层 OOXML 部件，把图片以 WPS 单元格内图片（`DISPIMG` + `cellimages.xml`）方式写入指定单元格。

### 功能特性
- 统一接口 `insert_image`。
- 统一输入方式：`position_image_map=[{"row":..., "col":..., "img_path":...}]`。
- 不依赖 `pathlib.Path`，字符串路径可直接使用。
- 保留工作簿结构，输出采用原子写入。

### 安装

```bash
pip install ce_img_ll
```

### Python 用法

```python
from ce_img_ll import insert_image

insert_image(
    source_xlsx="./input.xlsx",
    output_xlsx="./output.xlsx",
    sheet_name="Sheet1",
    position_image_map=[
        {"row": 1, "col": 2, "img_path": "a.png"},
        {"row": 1, "col": 3, "img_path": "b.png"},
    ],
)
```

### CLI 用法

```bash
ce-img-ll --source-xlsx input.xlsx --output-xlsx out.xlsx --sheet Sheet1 --rc 1,2=a.png --rc 1,3=b.png
```

---

## English Documentation

`ce_img_ll` inserts images into `.xlsx` cells using WPS-specific in-cell image mechanics by editing OOXML parts directly (`DISPIMG` + `cellimages.xml`).

### Features
- Unified API: `insert_image`.
- Unified input shape: `position_image_map=[{"row":..., "col":..., "img_path":...}]`.
- No `pathlib.Path` requirement for callers; plain string paths are supported.
- Preserves workbook structure and writes output atomically.

### Installation

```bash
pip install ce_img_ll
```

### Python Usage

```python
from ce_img_ll import insert_image

insert_image(
    source_xlsx="./input.xlsx",
    output_xlsx="./output.xlsx",
    sheet_name="Sheet1",
    position_image_map=[
        {"row": 1, "col": 2, "img_path": "a.png"},
        {"row": 1, "col": 3, "img_path": "b.png"},
    ],
)
```

### CLI Usage

```bash
ce-img-ll --source-xlsx input.xlsx --output-xlsx out.xlsx --sheet Sheet1 --rc 1,2=a.png --rc 1,3=b.png
```
