--- 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.