aws-samples / aws-samples/sample-rvtools-processor

Does not support csv

オープン
#4 コメント 0 件 リアクション 0 件 担当者 0 名 GitHub で見る
主要言語
Python
スター
9
フォーク
4
PR マージ指標
30日以内にマージされた PR はありません

説明

`openpyxl` doesn't support csv so it needs to be handled separately or simply converted to excel first.

While nothing on github indicates it does support CSV, the [blog post](https://aws.amazon.com/blogs/migration-and-modernization/anonymizing-rvtools-data-for-aws-migration-planning/) does. It would be pretty simple to convert it and save temporary xlsx files to then process.
eg:
```python
import csv
from openpyxl import Workbook

def csv_to_excel(csv_file, excel_file):
wb = Workbook()
ws = wb.active
with open(csv_file, 'r', newline='', encoding='utf-8') as f:
reader = csv.reader(f)
for row in reader:
ws.append(row)
wb.save(excel_file)
```

Currently
```
> python rvtools_processor.py consolidate input1.csv input2.csv -o consolidated.csv

Starting consolidation of 2 files...
Processing: input1.csv
Error processing input1.csv: openpyxl does not support .csv file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
Processing: input2.csv
Error processing input2.csv: openpyxl does not support .csv file format, please check you can open it with Excel first. Supported formats are: .xlsx,.xlsm,.xltx,.xltm
Creating consolidated file: input2.csv
Error: At least one sheet must be visible
```

`Python 3.13.3`

```
Package Version
--------------- -----------
openpyxl 3.1.5
pandas 3.0.1
```

コントリビューションガイド

コントリビューションガイドを開く

調査の方向性

rvtools_processor.py の consolidate コマンドから始め、報告された CSV の呼び出しと openpyxl エラーを調査の入口として使用します。入力ファイルが現在どのように処理され、統合された出力がどのように作成されるかを確認してください。CSV 入力を統合しても「At least one sheet must be visible」エラーが発生しなければ完了です。

索引モデルが issue の本文から書いたものです。

評価

技術スタック
pandas, python
領域
cli, data
issue の種類
機能追加
難易度
3/5
見積もり時間
1〜2日
活発さ
静か
明瞭さ
おおむね明確
初心者へのやさしさ
55/100

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。