Skip to main content

Simple Excel to CSV converter with merged-cell propagation and cp932 encoding

Project description

xlsx2csv-mergefill

Excelファイル(.xlsx)を、データ処理に適したCSV形式へ変換するPythonライブラリです。 結合セルの補完や文字コード(cp932)対応により、業務システムへのデータ取り込みを容易にします。

特徴

  • 結合セルの自動補完 — 結合領域を左上セルの値で埋め、データ欠損を防止
  • cp932形式での出力 — Shift_JIS互換のCSVを出力(業務システムでの互換性重視)
  • 複数シートの一括変換 — Excelブック内の全シートを安全なファイル名で自動出力

インストール

pip install xlsx2csv-mergefill

使い方

1. ExcelファイルをCSVに一括変換

from xlsx2csv_mergefill import convert_file

convert_file("input.xlsx", "output")

output_シート名.csv という形式で出力されます。

2. 特定シートをPythonリストとして読み込み

from xlsx2csv_mergefill import read_sheet

rows = read_sheet("input.xlsx")

3. 全シートを辞書形式で読み込み

from xlsx2csv_mergefill import read_workbook

data = read_workbook("input.xlsx")

引数

  • input_path: 入力Excelファイルのパス
  • output_prefix: 出力ファイル名のプレフィックス(例:outputoutput_シート名.csv

戻り値

  • 成功時に 0 を返します。

例外

  • FileNotFoundError などの例外を送出することがあります。

制限事項

  • 入力形式は .xlsx のみ対応(.xls 非対応)
  • 出力形式は cp932 / カンマ区切り固定
  • 数式セルは計算済みの値として取得されます

ライセンス

本プロジェクトはMITライセンスの下で公開されています。詳細はLICENSEファイルをご覧ください。

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

xlsx2csv-mergefill-1.0.0.tar.gz (5.9 kB view details)

Uploaded Source

Built Distribution

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

xlsx2csv_mergefill-1.0.0-py3-none-any.whl (6.0 kB view details)

Uploaded Python 3

File details

Details for the file xlsx2csv-mergefill-1.0.0.tar.gz.

File metadata

  • Download URL: xlsx2csv-mergefill-1.0.0.tar.gz
  • Upload date:
  • Size: 5.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.11.9

File hashes

Hashes for xlsx2csv-mergefill-1.0.0.tar.gz
Algorithm Hash digest
SHA256 31850a458d66eddec9174fac5ccfc69afd752a9aec1d0e92861e8056f8494169
MD5 ae7bddb9739d6c909440669589769e90
BLAKE2b-256 48a91fbc1015cb9468223d8ba1da00d50869cee04e70a2c72e56810e9238df36

See more details on using hashes here.

File details

Details for the file xlsx2csv_mergefill-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for xlsx2csv_mergefill-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 bc5a4bf1cab47fae7d3bfb8c9f80e8d2871fe0e4e009390a10e84c3682d0de80
MD5 e243d0b759386a9b8a494c83906ff822
BLAKE2b-256 43f7ded1814512bfeea8cc22a211c1f7164bee53440ae4824b43364223a9f149

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