Insert WPS in-cell images into XLSX by editing OOXML parts
Project description
ce_img_ll
中文说明
ce_img_ll 通过修改 XLSX 底层 OOXML 部件,把图片以 WPS 单元格内图片(DISPIMG + cellimages.xml)方式批量写入指定单元格。
功能特性
- 统一批量接口
insert_image,可覆盖单个或多个单元格场景。 - 保留工作簿结构,输出采用原子写入,降低损坏风险。
- 提供 Python API 与命令行工具。
兼容性说明
- 本库实现的是 WPS 专有单元格图片机制。
- 在 Microsoft Excel 中,可能显示为公式文本或仅部分兼容。
安装
pip install ce_img_ll
Python 用法
from pathlib import Path
from ce_img_ll import insert_image
insert_image(
source_xlsx=Path("input.xlsx"),
output_xlsx=Path("output.xlsx"),
sheet_name="Sheet1",
cell_image_map={
"A1": Path("a.png"),
"C3": Path("b.jpg"),
},
)
CLI 用法
ce-img-ll --source-xlsx input.xlsx --output-xlsx out.xlsx --sheet Sheet1 --pair A1=a.png --pair B2=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
- Single unified batch API:
insert_image. - Works for one or multiple cell-image mappings.
- Preserves workbook structure and writes output atomically.
- Provides both Python API and CLI.
Compatibility
- This library implements WPS-specific in-cell image behavior.
- In Microsoft Excel, cells may show formula text or partial compatibility.
Installation
pip install ce_img_ll
Python Usage
from pathlib import Path
from ce_img_ll import insert_image
insert_image(
source_xlsx=Path("input.xlsx"),
output_xlsx=Path("output.xlsx"),
sheet_name="Sheet1",
cell_image_map={
"A1": Path("a.png"),
"C3": Path("b.jpg"),
},
)
CLI Usage
ce-img-ll --source-xlsx input.xlsx --output-xlsx out.xlsx --sheet Sheet1 --pair A1=a.png --pair B2=b.png
Development
python -m venv .venv
.venv\\Scripts\\python -m pip install -e . pytest
.venv\\Scripts\\python -m pytest tests
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
ce_img_ll-0.2.0.tar.gz
(11.1 kB
view details)
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
ce_img_ll-0.2.0-py3-none-any.whl
(10.9 kB
view details)
File details
Details for the file ce_img_ll-0.2.0.tar.gz.
File metadata
- Download URL: ce_img_ll-0.2.0.tar.gz
- Upload date:
- Size: 11.1 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4b5b4db72eae4a876a5d46b71e0f696874a35f8e79d6da28f1efb40f46ae5242
|
|
| MD5 |
e43b69876906632e6af4a898f5323116
|
|
| BLAKE2b-256 |
e0c10f20d020e73d62501868fc2929e629abf22cb1ccf58731e9c23dcde2b18e
|
File details
Details for the file ce_img_ll-0.2.0-py3-none-any.whl.
File metadata
- Download URL: ce_img_ll-0.2.0-py3-none-any.whl
- Upload date:
- Size: 10.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4a8b1be9c759b2d33038c0c9bd54d303d3e8112c3ea73c03d017c67d44cf688b
|
|
| MD5 |
4f39990709f27518a7578b556d84c2b1
|
|
| BLAKE2b-256 |
ac407f98b7f6a2942c753f9dc9a13b53a116a61b63c98ecea43bbfe04b8d0825
|