File size: 3,726 Bytes
c329686
 
 
 
 
 
 
 
 
 
5e9268b
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
---
title: WikiTales
emoji: πŸ“š
colorFrom: indigo
colorTo: pink
sdk: streamlit
sdk_version: "1.35.0"
app_file: app.py
pinned: false
---
# πŸ“– WikiTales – Interactive Historical Storybooks

> WikiTales is an open-source, story-driven web app that transforms raw historical data from Wikimedia projects into immersive, engaging storybook-style narratives. Built with Python and Streamlit, it’s designed to help learners explore the past like never before.

---

## Team Members
- Rishi Palavarapu
- Harsha Ambati
- Rishitha Reddy
- Yaswanth Ambati

---

## πŸš€ Overview

WikiTales bridges storytelling and research by compiling content from **Wikimedia public APIs** such as Wikipedia, Wikiquote, Wikidata, Wikisource, Wikibooks, and more. It generates narrative summaries, trivia facts, quotes, timelines, and glossary definitions based on user-entered topics.

---

## πŸ” Key Features

- 🧠 **AI-generated Story Narratives** based on historical events and figures
- 🎭 **Narrator Styles**: Choose between historian, eyewitness, journalist, AI assistant, etc.
- 🧾 **Dynamic Timelines** of important events
- πŸ’¬ **Quotes & Primary Sources** from Wikiquote and Wikisource
- 🧠 **β€œDid You Know?” Facts** from Wikidata
- πŸ“š **Wikibooks Sidebar** for extended learning material
- πŸ“Έ **Image Carousel** using Wikimedia Commons

---

## πŸ› οΈ Built With

- **Frontend & UI**: [Streamlit](https://streamlit.io/)
- **Language**: Python 3.10+
- **Data Sources**:
  - [Wikipedia API](https://en.wikipedia.org/w/api.php)
  - [Wikidata API](https://www.wikidata.org/w/api.php)
  - [Wikibooks API](https://en.wikibooks.org/w/api.php)
  - [Wikiquote API](https://en.wikiquote.org/w/api.php)
  - [Wiktionary API](https://en.wiktionary.org/w/api.php)
  - [Wikisource API](https://en.wikisource.org/w/api.php)
  - [Wikimedia Commons API](https://commons.wikimedia.org/w/api.php)

---

## βš™οΈ How It Works

1. **User enters a topic** (e.g. *World War II*).
2. WikiTales fetches:
   - Summary from Wikipedia
   - Quotes from Wikiquote
   - Timeline from Wikidata
   - Definitions from Wiktionary
   - Images from Commons
   - Source documents from Wikisource
   - Related books from Wikibooks
3. Story is narrated using the selected voice and formatted as a storybook.
4. Additional enhancements include interactive glossary and image carousel.

---

## πŸ”§ Setup Instructions

To get started with this project, follow these steps:

```bash
# Clone the repository
git clone https://code.swecha.org/soai2025/soai-hackathon/team-titans.git

# Navigate to the project folder
cd team-titans

# (Optional but recommended) Create a virtual environment
python3 -m venv wikitales_venv
source wikitales_venv/bin/activate

# Install dependencies
pip install -r requirements.txt

# Run the app locally
streamlit run app.py
```

---

### πŸš€ Deployment

This app is designed to be deployed on [Hugging Face Spaces](https://huggingface.co/spaces) using the **Streamlit template**.

---

### πŸ—‚οΈ Project Structure

```
WikiTales/
β”œβ”€β”€ app.py                      # Main Streamlit app
β”œβ”€β”€ requirements.txt            # Python dependencies
β”œβ”€β”€ README.md                   # Project overview and setup
β”œβ”€β”€ story_engine/               # All logic modules for fetching and generating story content
β”‚   β”œβ”€β”€ __init__.py
β”‚   β”œβ”€β”€ wikipedia.py
β”‚   β”œβ”€β”€ wikiquote.py
β”‚   β”œβ”€β”€ wikisource.py
β”‚   β”œβ”€β”€ commons.py
β”‚   β”œβ”€β”€ wikidata.py
β”‚   β”œβ”€β”€ wikibooks.py
β”‚   β”œβ”€β”€ formatter.py
β”‚   └── story_builder.py        # Core function to build story from APIs

```

> πŸ“ `story_engine/` contains modular Python files to keep the logic clean and testable.