Skip to content

Commit a2aee12

Browse files
committed
refactor: rename pptxr to tppt across the codebase for consistency
1 parent ab81604 commit a2aee12

33 files changed

+97
-109
lines changed

README.md

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,17 @@
1-
# pptxr
1+
# tppt
22

3-
pptxrは型安全なPowerPointプレゼンテーションビルダーです。このライブラリを使用すると、Pythonコードからパワーポイントを簡単に生成できます。
3+
tpptは型安全なPowerPointプレゼンテーションビルダーです。このライブラリを使用すると、Pythonコードからパワーポイントを簡単に生成できます。
44

55
## インストール
66

77
```bash
8-
pip install pptxr
8+
pip install tppt
99
```
1010

1111
## 使用例
1212

1313
```python
14-
from pptxr import Presentation, SlideTemplate, SlideMaster, SlideBuilder
14+
from tppt import Presentation, SlideTemplate, SlideMaster, SlideBuilder
1515

1616

1717
class MySlideTemplate(SlideTemplate):
@@ -57,7 +57,7 @@ presentation.save("output.pptx")
5757
- `_builders`: ビルダーパターンの実装
5858
- `_presentation`: プレゼンテーションクラス
5959
- `_slide_master`: スライドマスタークラス
60-
- `_pptxr`: python-pptxとのインターフェース
60+
- `_tppt`: python-pptxとのインターフェース
6161

6262
## ライセンス
6363

design/全体設計.md

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
次のフォルダ構成をとる。
33

44
```
5-
pptxr/
5+
tppt/
66
├── __init__.py
77
├── _slide_master.py # SlideMaster クラスを実装するファイル
88
├── _presentation.py # Presentation クラスを実装するファイル
@@ -14,7 +14,7 @@ pptxr/
1414
├── _pptx/ # python-pptx のコードは型安全でないので、ここに配置して型安全なラップクラスを用意する
1515
│ ├── __init__.py
1616
│ ├── converters.py
17-
│ └── types.py # python-pptx の型に pptxr.types をマッピングさせる
17+
│ └── types.py # python-pptx の型に tppt.types をマッピングさせる
1818
├── _builder/ # ビルダーパターンのクラスを実装する。
1919
│ ├── __init__.py
2020
│ ├── presentation.py
@@ -25,14 +25,14 @@ pptxr/
2525

2626
_pptx フォルダには、 python-pptx のコードをラップしたクラスを配置する。
2727

28-
pptxr の型を python-pptx と相互変換するための関数群もここにまとめる。
28+
tppt の型を python-pptx と相互変換するための関数群もここにまとめる。
2929

3030
ラップしたクラスはプライベートメンバーとして python-pptx のデータを保持する。
3131
メンバ変数はプライベートである python-pptx のデータのみにする。
32-
クラスが持つメソッドのインターフェースの入出力は、コンストラクタと PptxConvertible のメソッド以外は全て pptxr の型で表現する。
33-
コンストラクタは python-pptx か pptxr のどちらかの型を第一引数として受け入れるのみにする。
32+
クラスが持つメソッドのインターフェースの入出力は、コンストラクタと PptxConvertible のメソッド以外は全て tppt の型で表現する。
33+
コンストラクタは python-pptx か tppt のどちらかの型を第一引数として受け入れるのみにする。
3434

35-
python-pptx のデータを取り出し、対応する pptxr の型に変換して出力する。
35+
python-pptx のデータを取り出し、対応する tppt の型に変換して出力する。
3636

3737
## ビルダーパターン
3838

@@ -63,7 +63,7 @@ Presentation は、内部で Slides のデータと、 pptx ファイルを保
6363
save メソッドを呼ぶと、内部のデータを pptx ファイルに保存する。
6464

6565
```python
66-
from pptxr import Presentation
66+
from tppt import Presentation
6767

6868
presentation = (
6969
Presentation.builder()
@@ -87,7 +87,7 @@ presentation = (
8787
## スライドマスター
8888

8989
```python
90-
from pptxr import Presentation, SlideTemplate
90+
from tppt import Presentation, SlideTemplate
9191

9292
class MySlideTemplate(SlideTemplate):
9393
...

examples/simple_example.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
1-
"""Simple example of using pptxr."""
1+
"""Simple example of using tppt."""
22

33
from pathlib import Path
44

5-
from pptxr import Presentation, SlideBuilder
5+
from tppt import Presentation, SlideBuilder
66

77
EXAMPLE_DIR = Path(__file__).parent
88

@@ -23,7 +23,7 @@ def main():
2323
height=(50, "pt"),
2424
)
2525
.text(
26-
"Example of using pptxr library", # Subtitle
26+
"Example of using tppt library", # Subtitle
2727
left=(50, "pt"),
2828
top=(120, "pt"),
2929
width=(400, "pt"),

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
{
2-
"name": "pptxr",
2+
"name": "tppt",
33
"version": "1.0.0",
44
"description": "",
55
"main": "index.js",

pyproject.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
[project]
2-
name = "pptxr"
2+
name = "tppt"
33
version = "0.1.0"
44
description = "PowerPoint Builder"
55
readme = "README.md"
@@ -48,7 +48,7 @@ typecheck = "task typecheck-pyright"
4848
test = "pytest"
4949

5050
[tool.pyright]
51-
include = ["src/pptxr", "examples", "tests"]
51+
include = ["src/tppt", "examples", "tests"]
5252
exclude = [ "**/site-packages", ".venv/**"]
5353

5454
[tool.mypy]

src/pptxr/__init__.py

Lines changed: 0 additions & 20 deletions
This file was deleted.

src/pptxr/_pptxr/slide_master.py

Lines changed: 0 additions & 7 deletions
This file was deleted.

src/tppt/__init__.py

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
"""Typed Python PowerPoint Builder"""
2+
3+
from tppt._pptx.presentation import Presentation
4+
from tppt._pptx.shape import Shape
5+
from tppt._pptx.slide import Slide, SlideBuilder
6+
from tppt._pptx.slide_layout import SlideLayout
7+
from tppt._pptx.slide_master import SlideMaster
8+
from tppt._tppt.slide_master import tpptSlideMaster
9+
10+
__all__ = [
11+
# Pptx
12+
"Presentation",
13+
"Shape",
14+
"Slide",
15+
"SlideBuilder",
16+
"SlideLayout",
17+
"SlideMaster",
18+
# tppt
19+
"tpptSlideMaster",
20+
]
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)