convoviz 0.3.0__py3-none-any.whl → 0.3.1__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
convoviz/__init__.py CHANGED
@@ -1,6 +1,6 @@
1
1
  """Convoviz - ChatGPT data visualization and export tool."""
2
2
 
3
- from convoviz import analysis, config, io, models, renderers, utils
3
+ from convoviz import config, io, models, renderers, utils
4
4
  from convoviz.config import ConvovizConfig, get_default_config
5
5
  from convoviz.models import Conversation, ConversationCollection, Message, Node
6
6
  from convoviz.pipeline import run_pipeline
@@ -23,3 +23,12 @@ __all__ = [
23
23
  "get_default_config",
24
24
  "run_pipeline",
25
25
  ]
26
+
27
+
28
+ def __getattr__(name: str):
29
+ """Lazy import for optional submodules like analysis."""
30
+ if name == "analysis":
31
+ from convoviz import analysis
32
+
33
+ return analysis
34
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
@@ -1,9 +1,22 @@
1
- """Data analysis and visualization for convoviz."""
1
+ """Data analysis and visualization for convoviz.
2
2
 
3
- from convoviz.analysis.graphs import generate_week_barplot
4
- from convoviz.analysis.wordcloud import generate_wordcloud
3
+ Requires the [viz] extra: pip install convoviz[viz]
4
+ """
5
5
 
6
6
  __all__ = [
7
7
  "generate_week_barplot",
8
8
  "generate_wordcloud",
9
9
  ]
10
+
11
+
12
+ def __getattr__(name: str):
13
+ """Lazy import for visualization functions requiring optional dependencies."""
14
+ if name == "generate_week_barplot":
15
+ from convoviz.analysis.graphs import generate_week_barplot
16
+
17
+ return generate_week_barplot
18
+ if name == "generate_wordcloud":
19
+ from convoviz.analysis.wordcloud import generate_wordcloud
20
+
21
+ return generate_wordcloud
22
+ raise AttributeError(f"module {__name__!r} has no attribute {name!r}")
convoviz/pipeline.py CHANGED
@@ -6,7 +6,7 @@ from shutil import rmtree
6
6
  from rich.console import Console
7
7
 
8
8
  from convoviz.config import ConvovizConfig, OutputKind
9
- from convoviz.exceptions import InvalidZipError
9
+ from convoviz.exceptions import ConfigurationError, InvalidZipError
10
10
  from convoviz.io.loaders import (
11
11
  find_latest_bookmarklet_json,
12
12
  load_collection_from_json,
@@ -122,7 +122,13 @@ def run_pipeline(config: ConvovizConfig) -> None:
122
122
  # Generate graphs (if selected)
123
123
  if OutputKind.GRAPHS in selected_outputs:
124
124
  # Lazy import to allow markdown-only usage without matplotlib
125
- from convoviz.analysis.graphs import generate_graphs
125
+ try:
126
+ from convoviz.analysis.graphs import generate_graphs
127
+ except ModuleNotFoundError as e:
128
+ raise ConfigurationError(
129
+ "Graph generation requires matplotlib. "
130
+ "Install with: pip install convoviz[viz]"
131
+ ) from e
126
132
 
127
133
  graph_folder = output_folder / "Graphs"
128
134
  graph_folder.mkdir(parents=True, exist_ok=True)
@@ -140,7 +146,13 @@ def run_pipeline(config: ConvovizConfig) -> None:
140
146
  # Generate word clouds (if selected)
141
147
  if OutputKind.WORDCLOUDS in selected_outputs:
142
148
  # Lazy import to allow markdown-only usage without wordcloud/nltk
143
- from convoviz.analysis.wordcloud import generate_wordclouds
149
+ try:
150
+ from convoviz.analysis.wordcloud import generate_wordclouds
151
+ except ModuleNotFoundError as e:
152
+ raise ConfigurationError(
153
+ "Word cloud generation requires wordcloud and nltk. "
154
+ "Install with: pip install convoviz[viz]"
155
+ ) from e
144
156
 
145
157
  wordcloud_folder = output_folder / "Word-Clouds"
146
158
  wordcloud_folder.mkdir(parents=True, exist_ok=True)
@@ -1,6 +1,6 @@
1
1
  Metadata-Version: 2.4
2
2
  Name: convoviz
3
- Version: 0.3.0
3
+ Version: 0.3.1
4
4
  Summary: Get analytics and visualizations on your ChatGPT data!
5
5
  Keywords: markdown,chatgpt,openai,visualization,analytics,json,export,data-analysis,obsidian
6
6
  Author: Mohamed Cheikh Sidiya
@@ -9,19 +9,18 @@ License-Expression: MIT
9
9
  Classifier: License :: OSI Approved :: MIT License
10
10
  Classifier: Programming Language :: Python :: 3
11
11
  Classifier: Programming Language :: Python :: 3.12
12
- Requires-Dist: matplotlib>=3.9.4
13
- Requires-Dist: nltk>=3.9.2
14
12
  Requires-Dist: orjson>=3.11.5
15
- Requires-Dist: pillow>=11.3.0
16
13
  Requires-Dist: pydantic>=2.12.5
17
14
  Requires-Dist: pydantic-settings>=2.7.0
18
15
  Requires-Dist: questionary>=2.1.1
19
16
  Requires-Dist: rich>=14.2.0
20
17
  Requires-Dist: tqdm>=4.67.1
21
18
  Requires-Dist: typer>=0.21.0
22
- Requires-Dist: wordcloud>=1.9.5
19
+ Requires-Dist: nltk>=3.9.2 ; extra == 'viz'
20
+ Requires-Dist: wordcloud>=1.9.5 ; extra == 'viz'
23
21
  Requires-Python: >=3.12
24
22
  Project-URL: Repository, https://github.com/mohamed-chs/chatgpt-history-export-to-md
23
+ Provides-Extra: viz
25
24
  Description-Content-Type: text/markdown
26
25
 
27
26
  # Convoviz 📊: Visualize your entire ChatGPT data
@@ -49,23 +48,19 @@ See examples [here](demo).
49
48
 
50
49
  ### 2. Install the tool 🛠
51
50
 
52
- Try it without installing using uv ([astral-sh/uv](https://github.com/astral-sh/uv?tab=readme-ov-file#highlights)):
51
+ With uv ([astral-sh/uv](https://github.com/astral-sh/uv?tab=readme-ov-file#highlights)):
53
52
 
54
53
  ```bash
55
- uvx convoviz
56
- ```
57
-
58
- You can install it with uv (Recommended):
59
-
60
- ```bash
61
- uv tool install convoviz
54
+ uv tool install convoviz[viz]
62
55
  ```
63
56
 
64
57
  or pipx:
65
58
  ```bash
66
- pipx install convoviz
59
+ pipx install convoviz[viz]
67
60
  ```
68
61
 
62
+ The `[viz]` extra includes graphs and word clouds. If you only need markdown conversion, you can skip it for a faster install (`uv tool install convoviz`).
63
+
69
64
  ### 3. Run the tool 🏃‍♂️
70
65
 
71
66
  Simply run the command and follow the prompts:
@@ -137,12 +132,12 @@ It should(?) also work as library, so you can import and use the models and func
137
132
 
138
133
  ### Offline / reproducible runs
139
134
 
140
- Convoviz uses NLTK stopwords for word clouds. If youre offline and NLTK data isnt already installed, pre-download it once:
135
+ Word clouds use NLTK stopwords. If you're offline and NLTK data isn't installed yet, pre-download it:
141
136
 
142
137
  ```bash
143
- uv run python -c "import nltk; nltk.download('stopwords')"
138
+ python -c "import nltk; nltk.download('stopwords')"
144
139
  ```
145
140
 
146
141
  ### Bookmarklet
147
142
 
148
- Theres also a JavaScript bookmarklet flow under `js/` (experimental) for exporting additional conversation data outside the official ZIP export.
143
+ There's also a JavaScript bookmarklet flow under `js/` (experimental) for exporting additional conversation data outside the official ZIP export.
@@ -1,6 +1,6 @@
1
- convoviz/__init__.py,sha256=bQLCHO2U9EyMTGqNgsYiCtBQKTKNj4iIM3-TwIkrnRY,612
1
+ convoviz/__init__.py,sha256=UjwkFEmRXhE-3qhsoGTG9XhtoL2cP0o4h3Sp9fcA2Ic,858
2
2
  convoviz/__main__.py,sha256=1qiGW13_SgL7wJi8iioIN-AAHGkNGnEl5q_RcPUrI0s,143
3
- convoviz/analysis/__init__.py,sha256=FxgH5JJpyypiLJpMQn_HlM51jnb8lQdP63_C_W3Dlx4,241
3
+ convoviz/analysis/__init__.py,sha256=pmUm9yU7VtEbAea56uqgUvpicADVg9BWidgL227HZUU,648
4
4
  convoviz/analysis/graphs.py,sha256=4uGxVVnbDnBODPlu3g9jZPl6X3JEb4Ri1jXEekhV7-8,29681
5
5
  convoviz/analysis/wordcloud.py,sha256=tWQolVTILw40DXLDw6m7O8blDUBRrNG1FqRBA95ISEA,5844
6
6
  convoviz/assets/colormaps.txt,sha256=59TSGz428AxY14AEvymAH2IJ2RT9Mlp7Sy0N12NEdXQ,108
@@ -49,13 +49,13 @@ convoviz/models/collection.py,sha256=L658yKMNC6IZrfxYxZBe-oO9COP_bzVfRznnNon7tfU
49
49
  convoviz/models/conversation.py,sha256=ssx1Z6LM9kJIx3OucQW8JVoAc8zCdxj1iOLtie2B3ak,5678
50
50
  convoviz/models/message.py,sha256=0CJ9hJ1rQiesn1SgHqFgEgKUgS7XAPGtSunQl5q8Pl4,8316
51
51
  convoviz/models/node.py,sha256=1vBAtKVscYsUBDnKAOyLxuZaK9KoVF1dFXiKXRHxUnY,1946
52
- convoviz/pipeline.py,sha256=gO-lLEK8Hme6Sea6soE1idI7sSqrX4W0tgaEFHAJQ_g,5831
52
+ convoviz/pipeline.py,sha256=GIEsDV9Gr1LJdr5RulzkZoevxryP_SR4YOAb7XpwtSw,6328
53
53
  convoviz/py.typed,sha256=47DEQpj8HBSa-_TImW-5JCeuQeRkm5NMpJWZG3hSuFU,0
54
54
  convoviz/renderers/__init__.py,sha256=IQgwD9NqtUgbS9zwyPBNZbBIZcFrbZ9C7WMAV-X3Xdg,261
55
55
  convoviz/renderers/markdown.py,sha256=55PACkd-F0mmBXWXQ5SrfJr3UNrK_z2spQnePdk1UsQ,7849
56
56
  convoviz/renderers/yaml.py,sha256=XG1s4VhDdx-TiqekTkgED87RZ1lVQ7IwrbA-sZHrs7k,4056
57
57
  convoviz/utils.py,sha256=IQEKYHhWOnYxlr4GwAHoquG0BXTlVRkORL80oUSaIeQ,3417
58
- convoviz-0.3.0.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
59
- convoviz-0.3.0.dist-info/entry_points.txt,sha256=HYsmsw5vt36yYHB05uVU48AK2WLkcwshly7m7KKuZMY,54
60
- convoviz-0.3.0.dist-info/METADATA,sha256=pW4mfDwUdNzFFQ-1WAvDRD3L3ySDcSZRgFGWifQrAdw,5238
61
- convoviz-0.3.0.dist-info/RECORD,,
58
+ convoviz-0.3.1.dist-info/WHEEL,sha256=XV0cjMrO7zXhVAIyyc8aFf1VjZ33Fen4IiJk5zFlC3g,80
59
+ convoviz-0.3.1.dist-info/entry_points.txt,sha256=HYsmsw5vt36yYHB05uVU48AK2WLkcwshly7m7KKuZMY,54
60
+ convoviz-0.3.1.dist-info/METADATA,sha256=0Botn_h6f6lZeHkRrfn8aiiTIhRVnMfbVGjwDDtoe2Y,5264
61
+ convoviz-0.3.1.dist-info/RECORD,,