mindquest 0.1.0__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.
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2025 Dima Statz
4
+
5
+ Permission is hereby granted, free of charge, to any person obtaining a copy
6
+ of this software and associated documentation files (the "Software"), to deal
7
+ in the Software without restriction, including without limitation the rights
8
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9
+ copies of the Software, and to permit persons to whom the Software is
10
+ furnished to do so, subject to the following conditions:
11
+
12
+ The above copyright notice and this permission notice shall be included in all
13
+ copies or substantial portions of the Software.
14
+
15
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16
+ IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17
+ FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18
+ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19
+ LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20
+ OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21
+ SOFTWARE.
@@ -0,0 +1,479 @@
1
+ Metadata-Version: 2.1
2
+ Name: mindquest
3
+ Version: 0.1.0
4
+ Summary: mindquest: An AI-powered platform that creates fun, educational podcasts for children aged 6–12 by turning verified facts into engaging audio stories using LLMs and high-quality text-to-speech technology
5
+ Home-page: https://github.com/dimastatz/whisper-flow
6
+ Author: Dima Statz
7
+ Author-email: dima.statz@gmail.com
8
+ License: UNKNOWN
9
+ Platform: UNKNOWN
10
+ Requires-Python: >=3.9
11
+ Description-Content-Type: text/markdown
12
+ License-File: LICENSE
13
+ Requires-Dist: pytest>=7.4.0
14
+ Requires-Dist: black==23.3.0
15
+ Requires-Dist: pylint==2.17.4
16
+ Requires-Dist: pytest-cov>=4.1.0
17
+ Requires-Dist: pylint-fail-under==0.3.0
18
+ Requires-Dist: requests>=2.31.0
19
+ Requires-Dist: beautifulsoup4>=4.12.0
20
+ Requires-Dist: openai>=1.0.0
21
+ Requires-Dist: ebooklib>=0.18
22
+ Requires-Dist: pypub>=1.1.0
23
+ Requires-Dist: wheel>=0.41.0
24
+
25
+ <div align="center">
26
+ <h1 align="center">🎙️ MindQuest</h1>
27
+ <h3>Automated AI-Powered Educational Content Studio for Kids (Ages 8–12)</h3>
28
+ <img src="https://img.shields.io/badge/Status-Active-green"> <img src="https://img.shields.io/badge/Coverage-95.04%25-brightgreen"> <img src="https://img.shields.io/badge/Pylint-9.93%2F10-brightgreen">
29
+ <br><br>
30
+ <img src="https://github.com/dimastatz/mindquest/blob/main/docs/imgs/mindquest.png?raw=true" width="256px">
31
+ </div>
32
+
33
+ ---
34
+
35
+ ## Overview
36
+
37
+ **MindQuest** is a Python-based AI platform that automatically generates engaging, educational content for children aged 8–12. It combines:
38
+
39
+ - **Educational Content** from WikiKids (age-appropriate information)
40
+ - **AI Script Generation** using ChatGPT-4 to create engaging dialogues
41
+ - **Podcast Production** with natural voice synthesis via OpenAI's TTS API
42
+ - **Mini-Book Generation** in EPUB/PDF formats with structured chapters
43
+ - **Character-Based Storytelling** featuring two distinct personalities:
44
+ - **Plato**: A wise, calm professor who explains concepts
45
+ - **Pixel**: A curious, energetic 10-year-old asking questions
46
+
47
+ The entire system is built with **pure functional programming**, comprehensive testing (95%+ coverage), and production-grade code quality.
48
+
49
+ ---
50
+
51
+ ## Quick Start
52
+
53
+ ### Installation
54
+
55
+ ```bash
56
+ # Clone the repository
57
+ git clone https://github.com/yourusername/mindquest.git
58
+ cd mindquest
59
+
60
+ # Create virtual environment
61
+ python3 -m venv .venv
62
+ source .venv/bin/activate
63
+
64
+ # Install dependencies
65
+ pip install -r requirements.txt
66
+ ```
67
+
68
+ ### Generate Your First Podcast
69
+
70
+ ```python
71
+ import os
72
+ from mindquest import generate_podcast, create_minibook
73
+
74
+ api_key = os.getenv("OPENAI_API_KEY")
75
+
76
+ # Generate a 5-minute English podcast about Solar System
77
+ generate_podcast(
78
+ topic="Solar System",
79
+ api_key=api_key,
80
+ output_file="podcast.mp3",
81
+ word_count=700,
82
+ languages="en"
83
+ )
84
+
85
+ # OR generate an educational mini-book (EPUB format)
86
+ ebook_path = create_minibook(
87
+ api_key=api_key,
88
+ topic="Solar System",
89
+ language="en",
90
+ output_format="epub"
91
+ )
92
+ ```
93
+
94
+ **Results:**
95
+ - Podcast: A professional 2.5 MB MP3 file ready to listen
96
+ - Mini-Book: An EPUB file with chapters and assessment questions
97
+
98
+ ### Generate in Different Languages
99
+
100
+ ```python
101
+ # Hebrew podcast about Drones
102
+ generate_podcast("Drones", api_key, "podcast_he.mp3", languages="he")
103
+
104
+ # Spanish mini-book about Ancient Egypt
105
+ create_minibook(api_key, "Ancient Egypt", language="es", output_format="epub")
106
+
107
+ # French podcast about Dinosaurs
108
+ generate_podcast("Dinosaurs", api_key, "podcast_fr.mp3", languages="fr")
109
+
110
+ # Multilingual podcast (English, Spanish, French)
111
+ generate_podcast("Space Exploration", api_key, languages="en,es,fr")
112
+ ```
113
+
114
+ ---
115
+
116
+ ## Architecture
117
+
118
+ ### Core Modules
119
+
120
+ **[mindquest/studio.py](mindquest/studio.py)** - Main production engine with:
121
+
122
+ ```python
123
+ create_script() # Generate educational scripts from WikiKids
124
+ parse_script_segments() # Extract character dialogues
125
+ voice_over() # Synthesize audio from scripts
126
+ extract_character_audio() # Generate audio for specific characters
127
+ generate_podcast() # Complete end-to-end podcast production
128
+ create_minibook() # Generate EPUB/PDF mini-books with chapters
129
+ _parse_minibook_markdown() # Parse markdown into structured chapters
130
+ _create_epub_file() # Generate EPUB files
131
+ _create_pdf_file() # Generate PDF files
132
+ ```
133
+
134
+ **[mindquest/utils/chatgpt.py](mindquest/utils/chatgpt.py)** - OpenAI integration:
135
+ - Script generation via ChatGPT-4
136
+ - Audio synthesis via OpenAI TTS API
137
+ - Mini-book content generation via ChatGPT-4
138
+
139
+ **[mindquest/utils/wikikids.py](mindquest/utils/wikikids.py)** - Content sourcing:
140
+ - WikiKids API integration for age-appropriate facts
141
+ - Information gathering and summarization
142
+
143
+ **[mindquest/types.py](mindquest/types.py)** - Character profiles:
144
+ - PLATO: Wise Professor (onyx voice - deep, calm)
145
+ - PIXEL: Curious Child (shimmer voice - bright, energetic)
146
+
147
+ ---
148
+
149
+ ## API Reference
150
+
151
+ ### `generate_podcast()`
152
+
153
+ Generate a complete educational podcast.
154
+
155
+ ```python
156
+ generate_podcast(
157
+ topic: str, # Educational topic (e.g., "Dinosaurs")
158
+ api_key: str, # OpenAI API key
159
+ output_file: str = "podcast.mp3", # Output MP3 file path
160
+ word_count: int = 700, # Script length (700 ≈ 5 mins)
161
+ languages: str = "en" # Language code(s)
162
+ ) -> str # Returns path to generated podcast
163
+ ```
164
+
165
+ **Example:**
166
+ ```python
167
+ path = generate_podcast("Space Exploration", api_key, "my_podcast.mp3")
168
+ print(f"Podcast saved to: {path}")
169
+ ```
170
+
171
+ ### `create_script()`
172
+
173
+ Generate just the podcast script (without audio).
174
+
175
+ ```python
176
+ create_script(
177
+ api_key: str,
178
+ topic: str,
179
+ number_of_words: int = 500
180
+ ) -> str
181
+ ```
182
+
183
+ ### `voice_over()`
184
+
185
+ Convert script to audio with character voices.
186
+
187
+ ```python
188
+ voice_over(
189
+ api_key: str,
190
+ script: str,
191
+ languages: str = "en"
192
+ ) -> bytes
193
+ ```
194
+
195
+ ### `create_minibook()`
196
+
197
+ Generate an educational mini-book in EPUB or PDF format.
198
+
199
+ ```python
200
+ create_minibook(
201
+ api_key: str, # OpenAI API key
202
+ topic: str, # Educational topic
203
+ language: str = "en", # Language code (e.g., "he", "es", "fr")
204
+ number_of_words: int = 2000, # Target word count
205
+ output_format: str = "epub" # Format: "epub" or "pdf"
206
+ ) -> str # Returns path to generated file
207
+ ```
208
+
209
+ **Example:**
210
+ ```python
211
+ # Generate Hebrew EPUB about FPV Drones
212
+ file_path = create_minibook(
213
+ api_key=api_key,
214
+ topic="FPV Drones",
215
+ language="he",
216
+ output_format="epub"
217
+ )
218
+ print(f"Mini-book saved to: {file_path}") # fpv_drones_he.epub
219
+ ```
220
+
221
+ ---
222
+
223
+ ## Quality Metrics
224
+
225
+ ✅ **Test Coverage:** 95.04% (57 comprehensive tests)
226
+ ✅ **Code Quality:** 9.93/10 Pylint score
227
+ ✅ **Testing Framework:** pytest with pure function tests
228
+ ✅ **Type Hints:** Full type annotation coverage
229
+ ✅ **Error Handling:** Comprehensive exception handling with descriptive messages
230
+ ✅ **Pure Functions:** 90%+ pure functional code (no side effects)
231
+
232
+ ### Running Tests
233
+
234
+ ```bash
235
+ # Run all tests
236
+ python -m pytest tests/test_all.py -v
237
+
238
+ # Run with coverage report
239
+ python -m pytest tests/test_all.py --cov=mindquest --cov-report=term-missing
240
+
241
+ # Full validation (formatting, linting, tests)
242
+ ./run.sh -local
243
+ ```
244
+
245
+ ---
246
+
247
+ ## Example Workflows
248
+
249
+ ### Workflow 1: Generate English Podcast
250
+
251
+ ```python
252
+ from mindquest import generate_podcast
253
+ import os
254
+
255
+ api_key = os.getenv("OPENAI_API_KEY")
256
+ generate_podcast("The Water Cycle", api_key, "water_cycle.mp3")
257
+ ```
258
+
259
+ ### Workflow 2: Extract Character Audio
260
+
261
+ ```python
262
+ from mindquest import create_script, extract_character_audio
263
+ import os
264
+
265
+ api_key = os.getenv("OPENAI_API_KEY")
266
+
267
+ # Create script
268
+ script = create_script(api_key, "Ancient Rome", 600)
269
+
270
+ # Generate only Plato's audio
271
+ plato_audio = extract_character_audio(script, "Plato", api_key)
272
+
273
+ with open("plato_only.mp3", "wb") as f:
274
+ f.write(plato_audio)
275
+ ```
276
+
277
+ ### Workflow 3: Custom Language with Specific Word Count
278
+
279
+ ```python
280
+ from mindquest import generate_podcast
281
+ import os
282
+
283
+ api_key = os.getenv("OPENAI_API_KEY")
284
+
285
+ # 3-minute French podcast (~420 words at 140 wpm)
286
+ generate_podcast(
287
+ topic="Marie Curie",
288
+ api_key=api_key,
289
+ output_file="marie_curie_fr.mp3",
290
+ word_count=420,
291
+ languages="fr"
292
+ )
293
+ ```
294
+
295
+ ### Workflow 4: Generate Multi-Format Educational Content
296
+
297
+ ```python
298
+ from mindquest import generate_podcast, create_minibook
299
+ import os
300
+
301
+ api_key = os.getenv("OPENAI_API_KEY")
302
+ topic = "The Water Cycle"
303
+ language = "es" # Spanish
304
+
305
+ # Generate podcast for listening
306
+ podcast_path = generate_podcast(
307
+ topic=topic,
308
+ api_key=api_key,
309
+ output_file="water_cycle_podcast.mp3",
310
+ languages=language
311
+ )
312
+
313
+ # Generate mini-book for reading
314
+ ebook_path = create_minibook(
315
+ api_key=api_key,
316
+ topic=topic,
317
+ language=language,
318
+ output_format="epub"
319
+ )
320
+
321
+ print(f"Podcast: {podcast_path}")
322
+ print(f"E-Book: {ebook_path}")
323
+ ```
324
+
325
+ ---
326
+
327
+ ## Technology Stack
328
+
329
+ | Component | Technology |
330
+ |-----------|-----------|
331
+ | **Language** | Python 3.9+ |
332
+ | **LLM** | OpenAI ChatGPT-4 |
333
+ | **TTS** | OpenAI TTS API |
334
+ | **Content** | WikiKids |
335
+ | **Testing** | pytest, pytest-cov |
336
+ | **Code Quality** | pylint, black, type hints |
337
+ | **E-Book Format** | ebooklib, EPUB/PDF |
338
+ | **Package Manager** | pip |
339
+
340
+ ---
341
+
342
+ ## File Structure
343
+
344
+ ```
345
+ mindquest/
346
+ ├── __init__.py # Package exports
347
+ ├── studio.py # Main production engine (all functionality)
348
+ ├── types.py # Character profile definitions
349
+ └── utils/
350
+ ├── __init__.py
351
+ ├── chatgpt.py # OpenAI API integration
352
+ └── wikikids.py # WikiKids content sourcing
353
+
354
+ tests/
355
+ └── test_all.py # 37 comprehensive tests
356
+
357
+ docs/
358
+ ├── requirements.md # Original requirements
359
+ └── series/ # Example podcast content
360
+
361
+ requirements.txt # Project dependencies
362
+ README.md # This file
363
+ ```
364
+
365
+ ---
366
+
367
+ ## Dependencies
368
+
369
+ - **openai** ≥1.0.0 - OpenAI API client
370
+ - **requests** ≥2.31.0 - HTTP library for WikiKids
371
+ - **beautifulsoup4** ≥4.12.0 - HTML parsing for content extraction
372
+ - **ebooklib** ≥0.18 - EPUB file generation
373
+ - **pypub** ≥1.1.0 - Additional EPUB support
374
+ - **pytest** ≥7.4.0 - Testing framework
375
+ - **pytest-cov** ≥4.1.0 - Coverage reporting
376
+ - **black** - Code formatting
377
+ - **pylint** - Code linting
378
+
379
+ ---
380
+
381
+ ## Environment Setup
382
+
383
+ ### Set OpenAI API Key
384
+
385
+ ```bash
386
+ # macOS/Linux
387
+ export OPENAI_API_KEY=your_actual_key_here
388
+
389
+ # Windows (PowerShell)
390
+ $env:OPENAI_API_KEY="your_actual_key_here"
391
+ ```
392
+
393
+ ### Verify Installation
394
+
395
+ ```bash
396
+ python -c "from mindquest import generate_podcast; print('✅ MindQuest ready!')"
397
+ ```
398
+
399
+ ---
400
+
401
+ ## Features
402
+
403
+ ✨ **Automatic Content Generation**
404
+ - End-to-end pipeline from topic to podcast MP3 or e-book
405
+ - No manual script writing required
406
+ - Real-time progress feedback
407
+
408
+ 🎙️ **Podcast Production**
409
+ - Character-based dialogue generation
410
+ - Natural voice synthesis with distinct voices
411
+ - Multi-segment audio composition
412
+ - Export to MP3 format
413
+
414
+ 📖 **Mini-Book Generation**
415
+ - Structured chapters (7-10 per book)
416
+ - Assessment questions (3 per chapter)
417
+ - EPUB and PDF format support
418
+ - Table of contents with chapter organization
419
+
420
+ 🎭 **Character-Based Learning**
421
+ - Two distinct characters with different personalities
422
+ - Natural dialogue flow for engagement
423
+ - Character-specific voices (Plato: calm/explanatory, Pixel: energetic/curious)
424
+
425
+ 🌍 **Multilingual Support**
426
+ - English, Spanish, French, German, Hebrew, Arabic, and more
427
+ - Language parameter for both podcasts and mini-books
428
+ - Compatible with OpenAI's TTS and GPT language support
429
+
430
+ 📚 **Educational Content**
431
+ - WikiKids integration for age-appropriate information
432
+ - Factual, verified content sources
433
+ - Context-aware script and mini-book generation
434
+
435
+ 🔧 **Production-Grade Quality**
436
+ - 95%+ test coverage (57 tests)
437
+ - 9.93/10 code quality score
438
+ - Full error handling and validation
439
+ - Type hints throughout codebase
440
+ - Pure functional programming paradigm
441
+
442
+ ---
443
+
444
+ ## Roadmap
445
+
446
+ - [ ] Add support for multiple voice options per character
447
+ - [ ] Implement audio concatenation for proper multi-segment synthesis
448
+ - [ ] Add subtitle/transcript generation
449
+ - [ ] Support for custom character profiles
450
+ - [ ] Batch podcast generation API
451
+ - [ ] Web UI for podcast creation
452
+ - [ ] Distribution to podcast platforms (Spotify, Apple Podcasts)
453
+
454
+ ---
455
+
456
+ ## Contributing
457
+
458
+ Contributions welcome! Please ensure:
459
+
460
+ 1. All tests pass: `python -m pytest tests/test_all.py`
461
+ 2. Coverage maintained: >95%
462
+ 3. Code formatted: `black mindquest/`
463
+ 4. Linting passes: `pylint mindquest/`
464
+
465
+ ---
466
+
467
+ ## License
468
+
469
+ MIT License - See LICENSE file for details
470
+
471
+ ---
472
+
473
+ ## Acknowledgments
474
+
475
+ - **WikiKids API** - Educational content source
476
+ - **OpenAI** - ChatGPT and TTS APIs
477
+ - **Children's Learning Research** - Pedagogical principles
478
+
479
+
@@ -0,0 +1,5 @@
1
+ mindquest-0.1.0.dist-info/LICENSE,sha256=OYzD7TTKYWvcHJqkxR_am8nsGRvNViVw0rdXIuQMpcA,1067
2
+ mindquest-0.1.0.dist-info/METADATA,sha256=rUj-1DK4j1XFGJnIv8EKSiCn_auZceWNe6hwcH56dvw,12707
3
+ mindquest-0.1.0.dist-info/WHEEL,sha256=hPN0AlP2dZM_3ZJZWP4WooepkmU9wzjGgCLCeFjkHLA,92
4
+ mindquest-0.1.0.dist-info/top_level.txt,sha256=uVC_s6VXLerJjoOwgvUew5iRwSzMZ0AIxZPysAR5MUU,10
5
+ mindquest-0.1.0.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: bdist_wheel (0.46.3)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1 @@
1
+ mindquest