- pptx ファイルの Note 部分を抽出して、
<元のファイル名>.note.md
を出力する - 例)
sample01.pptx
->sample01.pptx.note.md
- Python (v3.9系)インストール or pyenv
python-pptx
が v3.10以降に対応していないため- 必要あれば venv などの仮想環境を使用する
- pyenv + venv 使用する場合
pyenv install 3.9
pyenv local 3.9
python3 --version
python3 -m venv .py39
source .py39/bin/activate
- パッケージインストール
# venv 使用している場合
python3 -m pip install python-pptx
# バイナリインストールして python3.9 コマンドを設定している場合
python3.9 -m pip install python-pptx
-
export_title_from_pptx_to_md.py
8 行目のpptx_folder_name = '/Users/xxx/yyy'
に pptx ファイルがあるディレクトリを設定 (末尾の/
は入れてはいけない) -
ディレクトリ構成の例 (
export_title_from_pptx_to_md.py
の場所はどこでも良い)
.
└── PowerPointFiles
├── Sample01.pptx
├── Sample02.pptx
└── Sample03.pptx
python3.9 export_title_from_pptx_to_md.py
- 実行後のディレクトリ構成
.
└── PowerPointFiles
├── Sample01.pptx
├── Sample02.pptx
└── Sample03.pptx
└── md
├── Sample01.md
├── Sample02.md
└── Sample03.md
extract_pptx_note.py
と同じディレクトリに以下のパスとファイル名で pptx ファイルを配置 (該当するもの全てが対象)PowerPointFiles/*.pptx
PowerPointFiles/v*/*.pptx
- ディレクトリ構成の例
.
├── PowerPointFiles
│ ├── Sample01.pptx
│ ├── Sample02.pptx
│ ├── v1.1
│ │ ├── Introduction.pptx
│ │ └── Closing.pptx
│ └── v2.0
│ ├── Introduction.pptx
│ └── Closing.pptx
└── extract_pptx_note.py
python3.9 extract_pptx_note.py
- 実行後のディレクトリ構成
.
├── PowerPointFiles
│ ├── Sample01.pptx
│ ├── Sample01.pptx.note.md
│ ├── Sample02.pptx
│ ├── Sample02.pptx.note.md
│ ├── v1.1
│ │ ├── Introduction.pptx
│ │ ├── Introduction.pptx.note.md
│ │ ├── Closing.pptx
│ │ └── Closing.pptx.note.md
│ └── v2.0
│ │ ├── Introduction.pptx
│ │ ├── Introduction.pptx.note.md
│ │ ├── Closing.pptx
│ │ └── Closing.pptx.note.md
└── extract_pptx_note.py