Skip to main content

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
  • 统一输入方式:position_image_map=[{"row":..., "col":..., "img_path":...}]
  • 不依赖 pathlib.Path,字符串路径可直接使用。
  • 保留工作簿结构,输出采用原子写入。

安装

pip install ce_img_ll

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 用法

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

pip install ce_img_ll

Python Usage

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

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

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.4.0.tar.gz (11.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

ce_img_ll-0.4.0-py3-none-any.whl (11.4 kB view details)

Uploaded Python 3

File details

Details for the file ce_img_ll-0.4.0.tar.gz.

File metadata

  • Download URL: ce_img_ll-0.4.0.tar.gz
  • Upload date:
  • Size: 11.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for ce_img_ll-0.4.0.tar.gz
Algorithm Hash digest
SHA256 8185e7461468ad81f1b21d3cef8bc2aedb319742ffc61ad3e3ba18bbc394e703
MD5 55355b7617a5015b9351b07d3eabcb31
BLAKE2b-256 b67336431f71a365a16910eba1d1354628f2d7839348f87e2848158ba37d0fb3

See more details on using hashes here.

File details

Details for the file ce_img_ll-0.4.0-py3-none-any.whl.

File metadata

  • Download URL: ce_img_ll-0.4.0-py3-none-any.whl
  • Upload date:
  • Size: 11.4 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.12.8

File hashes

Hashes for ce_img_ll-0.4.0-py3-none-any.whl
Algorithm Hash digest
SHA256 e6b23d7f0fa9ff295846810ffcc6b5f80264b4d548bd3e7ee1bda80a660d2bde
MD5 bc0645ec5b8d21842d9d5f14e8db6301
BLAKE2b-256 ae311536609ce361e42d5402afb0bb352d680226e85661984d5d0a5225cb8bed

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page