Skip to content

Commit bccd957

Browse files
authored
Merge pull request #30 from pjbollinger/fix-29-split-readme
Split README into separate English and Japanese files
2 parents 0d099ba + 3c46cce commit bccd957

2 files changed

Lines changed: 175 additions & 47 deletions

File tree

README.ja.md

Lines changed: 133 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,133 @@
1+
# pptx-template [![Build Status](https://travis-ci.org/m3dev/pptx-template.svg?branch=master)](https://travis-ci.org/m3dev/pptx-template)
2+
3+
## Overview
4+
5+
pptx-template は pptx のテンプレートを元に、別途用意した JSON 中の文字列や CSV データを差し込んだ pptx を生成するツールです。
6+
7+
定型レポートなどで大量のグラフ付きスライドを作成する際の作業を代行してくれます。
8+
9+
- テンプレートには "{sales.0.june.us}" のような形で JSON内の値を指す id を記入できます
10+
- python 3, pandas, pptx に依存しています
11+
- 扱う json や csv の 文字コードは utf-8 前提です
12+
13+
### Text substitution
14+
15+
<img src="docs/01.png?raw=true" width="80%" />
16+
17+
### CSV Import
18+
19+
<img src="docs/02.png?raw=true" width="80%" />
20+
21+
## Getting started
22+
23+
TBD
24+
25+
```
26+
$ pip install pptx-template
27+
$ echo '{ "slides": [ { "greeting" : "Hello!!" } ] }' > model.json
28+
29+
# prepare your template file (test.pptx) which contains "{greeting}" in somewhere
30+
31+
$ pptx-template --out out.pptx --template test.pptx --model model.json
32+
```
33+
34+
## 開発工程
35+
36+
### インストールの流れ
37+
38+
pyenvをインストールしておく
39+
40+
```
41+
git clone https://github.com/m3dev/pptx-template.git
42+
43+
pyenv install 3.7.1 # Pythonをインストール
44+
pyenv shell 3.7.1 # シェルで使うPython
45+
46+
venv .venv # 開発用の仮想環境を作成
47+
source .venv/bin/activate # 仮想環境を使用する
48+
49+
python setup.py develop # パッケージを開発用にインストール&依存パッケージをインストール
50+
pip install -r requirements.txt # 開発用のパッケージをインストール
51+
```
52+
53+
### REPLで実行 ※開発時はこの方法
54+
55+
pythonのREPLを起動
56+
57+
```
58+
cd {プロジェクトフォルダ}
59+
pyenv shell 3.7.1
60+
python
61+
```
62+
63+
REPL内で実行
64+
65+
```
66+
import sys
67+
from importlib import reload
68+
import pptx_template.cli as cli
69+
70+
71+
## 実行引数設定
72+
## sys.argv = ['{pyファイル名}', '--out', '{出力pptxファイルパス}', '--template', '{テンプレートpptxファイルパス}', '--model', '{設定xlsxファイルパス}', '--debug']
73+
## 以下の設定でテストファイルにて実行できます
74+
sys.argv = ['dummy.py', '--out', 'test/data3/out.pptx', '--template', 'test/data3/in.pptx', '--model', 'test/data3/in.xlsx', '--debug']
75+
76+
## 実行
77+
cli.main()
78+
79+
## 変更したソースをリロードして実行
80+
reload(sys.modules.get('pptx_template.xlsx_model'))
81+
reload(sys.modules.get('pptx_template.text'))
82+
reload(sys.modules.get('pptx_template.table'))
83+
reload(sys.modules.get('pptx_template.chart'))
84+
reload(sys.modules.get('pptx_template.core'))
85+
reload(sys.modules.get('pptx_template.cli'))
86+
cli.main()
87+
```
88+
89+
### コマンドラインで実行 ※githubに上がっているものの動作確認をしたい場合はこの方法
90+
91+
```
92+
## pptx_template --out {出力pptxファイルパス} --template {テンプレートpptxファイルパス} --model {設定xlsxファイルパス} --debug
93+
pptx_template --out test/data3/out.pptx --template test/data3/in.pptx --model test/data3/in.xlsx --debug
94+
```
95+
96+
### テスト実行
97+
98+
```
99+
pytest
100+
```
101+
102+
### ロールアウト手順
103+
104+
1. featureブランチを作成する
105+
2. 実装する
106+
3. 全pythonバージョンでtestが動くようにする
107+
4. pushする
108+
5. github上でpull requestを作成する
109+
6. コードレビューを依頼する
110+
7. QAを実施する(QAする人は、上記ローカル環境構築が必要)
111+
8. pll requestをマージする
112+
9. PyPIにアップロードする(PyPIのリポジトリ管理者のみ可)
113+
114+
### PyPIへのアップロード手順
115+
116+
1. パッケージインストール
117+
118+
```
119+
pip install wheel
120+
pip install twine
121+
```
122+
123+
2. コンパイル
124+
125+
```
126+
python setup.py bdist_wheel
127+
```
128+
129+
3. PyPIにアップロード
130+
131+
```
132+
twine upload dist/*
133+
```

README.md

Lines changed: 42 additions & 47 deletions
Original file line numberDiff line numberDiff line change
@@ -13,20 +13,12 @@ This helps your routine reporting work that have many manual copy-paste from exc
1313
- for now, only UTF-8 encoding is supported for json, csv
1414

1515
### Text substitution
16-
!<img src="docs/01.png?raw=true" width="80%" />
1716

18-
### CSV Import
19-
!<img src="docs/02.png?raw=true" width="80%" />
20-
21-
## Japanese translation
17+
<img src="docs/01.png?raw=true" width="80%" />
2218

23-
pptx-template は pptx のテンプレートを元に、別途用意した JSON 中の文字列や CSV データを差し込んだ pptx を生成するツールです。
24-
25-
定型レポートなどで大量のグラフ付きスライドを作成する際の作業を代行してくれます。
19+
### CSV Import
2620

27-
- テンプレートには "{sales.0.june.us}" のような形で JSON内の値を指す id を記入できます
28-
- python 3, pandas, pptx に依存しています
29-
- 扱う json や csv の 文字コードは utf-8 前提です
21+
<img src="docs/02.png?raw=true" width="80%" />
3022

3123
## Getting started
3224

@@ -41,51 +33,52 @@ $ echo '{ "slides": [ { "greeting" : "Hello!!" } ] }' > model.json
4133
$ pptx-template --out out.pptx --template test.pptx --model model.json
4234
```
4335

44-
## Development (Japanese)
36+
## Development
4537

46-
### インストールの流れ
38+
### Installation
39+
40+
Install using `pyenv`
4741

48-
pyenvをインストールしておく
4942
```
5043
git clone https://github.com/m3dev/pptx-template.git
5144
52-
pyenv install 3.7.1 # Pythonをインストール
53-
pyenv shell 3.7.1 # シェルで使うPython
45+
pyenv install 3.7.1 # Install Python
46+
pyenv shell 3.7.1 # Create Python shell
5447
55-
venv .venv # 開発用の仮想環境を作成
56-
source .venv/bin/activate # 仮想環境を使用する
48+
venv .venv # Create virtual environment for development
49+
source .venv/bin/activate # Use the virtual environment for development
5750
58-
python setup.py develop # パッケージを開発用にインストール&依存パッケージをインストール
59-
pip install -r requirements.txt # 開発用のパッケージをインストール
51+
python setup.py develop # Setup egg-info folder for development & Install dependencies
52+
pip install -r requirements.txt # Install dependencies
6053
```
6154

62-
### REPLで実行 ※開発時はこの方法
55+
### Run with REPL - Use this for development
6356

64-
pythonのREPLを起動
57+
Launch the Python REPL client
6558

6659
```
67-
cd {プロジェクトフォルダ}
60+
cd {project folder}
6861
pyenv shell 3.7.1
6962
python
7063
```
7164

72-
REPL内で実行
65+
Run the following with the Python REPL
7366

7467
```
7568
import sys
7669
from importlib import reload
7770
import pptx_template.cli as cli
7871
7972
80-
## 実行引数設定
81-
## sys.argv = ['{pyファイル名}', '--out', '{出力pptxファイルパス}', '--template', '{テンプレートpptxファイルパス}', '--model', '{設定xlsxファイルパス}', '--debug']
82-
## 以下の設定でテストファイルにて実行できます
73+
## Argument Settings
74+
## sys.argv = ['{filename.py}', '--out', '{file/path/output.pptx}', '--template', '{file/path/template.pptx}', '--model', '{file/path/data.xlsx}', '--debug']
75+
## Following is an example with test files
8376
sys.argv = ['dummy.py', '--out', 'test/data3/out.pptx', '--template', 'test/data3/in.pptx', '--model', 'test/data3/in.xlsx', '--debug']
8477
85-
## 実行
78+
## Run the program
8679
cli.main()
8780
88-
## 変更したソースをリロードして実行
81+
## Run the following after modifying the source code
8982
reload(sys.modules.get('pptx_template.xlsx_model'))
9083
reload(sys.modules.get('pptx_template.text'))
9184
reload(sys.modules.get('pptx_template.table'))
@@ -95,46 +88,48 @@ reload(sys.modules.get('pptx_template.cli'))
9588
cli.main()
9689
```
9790

98-
### コマンドラインで実行 ※githubに上がっているものの動作確認をしたい場合はこの方法
91+
### Run via CLI
9992

10093
```
101-
## pptx_template --out {出力pptxファイルパス} --template {テンプレートpptxファイルパス} --model {設定xlsxファイルパス} --debug
94+
## pptx_template --out {file/path/output.pptx} --template {file/path/template.pptx} --model {file/path/data.xlsx} --debug
10295
pptx_template --out test/data3/out.pptx --template test/data3/in.pptx --model test/data3/in.xlsx --debug
10396
```
10497

105-
### テスト実行
98+
### Run Tests
10699

107100
```
108101
pytest
109102
```
110103

111-
### ロールアウト手順
112-
1. featureブランチを作成する
113-
2. 実装する
114-
3. 全pythonバージョンでtestが動くようにする
115-
4. pushする
116-
5. github上でpull requestを作成する
117-
6. コードレビューを依頼する
118-
7. QAを実施する(QAする人は、上記ローカル環境構築が必要)
119-
8. pll requestをマージする
120-
9. PyPIにアップロードする(PyPIのリポジトリ管理者のみ可)
104+
### Deployment Process
105+
106+
1. Create a feature branch
107+
2. Implement the new feature
108+
3. Test with all versions of Python
109+
4. Push changes to the feature branch
110+
5. Create a Pull Request on Github
111+
6. Request a code review
112+
7. Verify QA(If you want to verify QA、build the source in your local environment)
113+
8. Merge Pull Request
114+
9. Upload to PyPI(Only for PyPI repository administrators)
121115

122-
### PyPIへのアップロード手順
123-
1. パッケージインストール
116+
### Upload to PyPI
117+
118+
1. Install packages needed for uploading to PyPI
124119

125120
```
126121
pip install wheel
127122
pip install twine
128123
```
129124

130-
2. コンパイル
125+
2. Compile
131126

132127
```
133128
python setup.py bdist_wheel
134129
```
135130

136-
3. PyPIにアップロード
131+
3. Upload to PyPI
137132

138133
```
139134
twine upload dist/*
140-
```
135+
```

0 commit comments

Comments
 (0)