Skip to content

Commit 0f36e63

Browse files
committed
feat: add version check example script and update installation documentation for clarity
1 parent cbe39fc commit 0f36e63

File tree

3 files changed

+44
-39
lines changed

3 files changed

+44
-39
lines changed
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
import tppt
2+
3+
print(tppt.__version__)

docs/docs/installation.md

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -6,31 +6,31 @@ TPPT can be installed using your favorite Python package manager.
66

77
- Python 3.11 or higher
88
- One of the following package managers:
9-
- pip
10-
- uv
11-
- hatch
12-
- poetry
13-
14-
=== "pip"
15-
```bash
16-
pip install tppt
17-
```
9+
* [uv](https://docs.astral.sh/uv/)
10+
* [poetry](https://python-poetry.org/)
11+
* [hatch](https://hatch.pypa.io/)
12+
* [pip](https://pip.pypa.io/)
1813

1914
=== "uv"
2015
```bash
2116
uv add tppt
2217
```
2318

24-
=== "hatch"
19+
=== "pip"
2520
```bash
26-
hatch add tppt
21+
pip install tppt
2722
```
2823

2924
=== "poetry"
3025
```bash
3126
poetry add tppt
3227
```
3328

29+
=== "hatch"
30+
```bash
31+
hatch add tppt
32+
```
33+
3434
## Optional Dependencies
3535

3636
TPPT provides optional dependencies for additional features:
@@ -39,15 +39,6 @@ TPPT provides optional dependencies for additional features:
3939

4040
For working with data frames:
4141

42-
=== "pip"
43-
```bash
44-
# For pandas support
45-
pip install "tppt[pandas]"
46-
47-
# For polars support
48-
pip install "tppt[polars]"
49-
```
50-
5142
=== "uv"
5243
```bash
5344
# For pandas support
@@ -57,13 +48,13 @@ For working with data frames:
5748
uv add "tppt[polars]"
5849
```
5950

60-
=== "hatch"
51+
=== "pip"
6152
```bash
6253
# For pandas support
63-
hatch add "tppt[pandas]"
54+
pip install "tppt[pandas]"
6455

6556
# For polars support
66-
hatch add "tppt[polars]"
57+
pip install "tppt[polars]"
6758
```
6859

6960
=== "poetry"
@@ -75,59 +66,67 @@ For working with data frames:
7566
poetry add "tppt[polars]"
7667
```
7768

69+
=== "hatch"
70+
```bash
71+
# For pandas support
72+
hatch add "tppt[pandas]"
73+
74+
# For polars support
75+
hatch add "tppt[polars]"
76+
```
77+
7878
### Pydantic Support
7979

8080
For Pydantic integration:
8181

82-
=== "pip"
83-
```bash
84-
pip install "tppt[pydantic]"
85-
```
86-
8782
=== "uv"
8883
```bash
8984
uv add "tppt[pydantic]"
9085
```
9186

92-
=== "hatch"
87+
=== "pip"
9388
```bash
94-
hatch add "tppt[pydantic]"
89+
pip install "tppt[pydantic]"
9590
```
9691

9792
=== "poetry"
9893
```bash
9994
poetry add "tppt[pydantic]"
10095
```
10196

97+
=== "hatch"
98+
```bash
99+
hatch add "tppt[pydantic]"
100+
```
101+
102102
### Development Tools
103103

104104
For development purposes:
105105

106-
=== "pip"
107-
```bash
108-
pip install "tppt[dev]"
109-
```
110-
111106
=== "uv"
112107
```bash
113108
uv add "tppt[dev]"
114109
```
115110

116-
=== "hatch"
111+
=== "pip"
117112
```bash
118-
hatch add "tppt[dev]"
113+
pip install "tppt[dev]"
119114
```
120115

121116
=== "poetry"
122117
```bash
123118
poetry add "tppt[dev]"
124119
```
125120

121+
=== "hatch"
122+
```bash
123+
hatch add "tppt[dev]"
124+
```
125+
126126
## Verifying Installation
127127

128128
You can verify the installation by running:
129129

130130
```python
131-
import tppt
132-
print(tppt.__version__)
131+
--8<-- "examples/check_version.py"
133132
```

src/tppt/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,6 @@
11
"""Typed Python PowerPoint Tool"""
22

3+
import importlib.metadata
34
from typing import Callable, Concatenate, ParamSpec, TypeVar
45

56
from tppt.pptx.presentation import Presentation
@@ -8,6 +9,8 @@
89

910
from . import types as types
1011

12+
__version__ = importlib.metadata.version("tppt")
13+
1114
T = TypeVar("T")
1215
P = ParamSpec("P")
1316

0 commit comments

Comments
 (0)