Mëso Shqip me AI
Mëso Shqip me AI is a Python-based educational platform for learning Albanian through vocabulary exploration, literary discussion, and quiz practice. The project combines a reusable Python package with a Streamlit interface so it works both as an application and as a codebase that can be extended or packaged further. It also supports persistent AI book discussions and retrieval-based AI responses grounded in selected EPUB content.
Overview
The platform helps users:
- search Albanian dictionary entries
- get simple AI explanations for dictionary words
- explore Albanian literary works in EPUB format
- chat with AI about selected books
- practice through multiple quiz modes
Motivation
Learning Albanian vocabulary and literature often means jumping between separate tools: a dictionary, reading material, notes, and practice exercises. This project brings those pieces together in one Python application so users can look up words, understand meanings, discuss books, and reinforce learning through quizzes in a single workflow.
Main Features
- Albanian dictionary search from
data/dictionary.csv - AI explanation for dictionary words in simple Albanian
- EPUB book assistant for Albanian literary works
- AI chat about selected books using extracted book context
- Quiz modes:
Kuiz i rastësishëmKuiz për libraAnglisht → Shqip
Technologies Used
- Python
- Streamlit
- OpenAI API
- pandas
- datasets
- EbookLib
- BeautifulSoup
- pytest
- Git
- GitHub
Project Structure
.
├── data/
│ ├── books/
│ └── dictionary.csv
├── meso_shqip_ai/
│ ├── __init__.py
│ ├── ai.py
│ ├── app_logic.py
│ ├── books.py
│ ├── dictionary.py
│ ├── quiz.py
│ └── utils.py
├── tests/
│ ├── test_books.py
│ ├── test_dictionary.py
│ └── test_quiz.py
├── download_dataset.py
├── pyproject.toml
├── requirements.txt
├── README.md
└── streamlit_app.py
Architecture
The project is organized in four layers:
- UI layer:
streamlit_app.pyhandles the Streamlit interface and user interactions. - Package/business logic layer:
meso_shqip_ai/contains reusable modules for dictionary lookup, book processing, quizzes, and app orchestration. - Data layer:
data/dictionary.csvanddata/books/*.epubprovide the local learning content. - Retrieval layer: EPUB books are split into text chunks and relevant sections are retrieved before sending context to the AI model.
- AI layer:
meso_shqip_ai/ai.pyintegrates the OpenAI API for explanations, book discussion, and quiz generation.
Setup
- Create a virtual environment:
python3 -m venv .venv
source .venv/bin/activate
- Install dependencies:
pip install -r requirements.txt
- Add a
.envfile for OpenAI-powered features:
OPENAI_API_KEY=your_openai_api_key_here
.env is required for OpenAI API usage. Do not commit API keys to the repository.
- Download the dictionary dataset if needed:
python download_dataset.py
- Run tests:
pytest
- Run the Streamlit app:
streamlit run streamlit_app.py
How to Run
streamlit run streamlit_app.py
Testing
Run the full test suite with:
pytest
The test suite covers dictionary behavior, book processing, and quiz generation logic.
The automated tests currently cover:
- dictionary search behavior
- Albanian character normalization
- book processing
- quiz generation
- quiz repetition avoidance logic
Python Package Usage
The core logic is reusable outside the Streamlit app.
Dictionary example:
from meso_shqip_ai.dictionary import DictionaryManager
manager = DictionaryManager("data/dictionary.csv")
results = manager.search("libër")
print(results[:3])
Books example:
from meso_shqip_ai.books import BookManager
manager = BookManager("data/books")
manager.load_books()
matches = manager.search("Skënderbeu")
print(matches[:2])
Quiz example:
from meso_shqip_ai.quiz import QuizManager
quiz_manager = QuizManager()
questions = quiz_manager.create_random_quiz(num_questions=4)
print(questions[0])
PyPI Packaging Note
The project is structured so that the core functionality lives inside the meso_shqip_ai Python package rather than only inside the Streamlit script. That makes it suitable for reuse in notebooks, scripts, future APIs, and eventual PyPI packaging with minimal restructuring.
Future Improvements
- React/Tailwind frontend on top of the existing Python backend
- Qdrant or another vector database for semantic retrieval over books and dictionary content
- semantic search using embeddings
- more Albanian books in EPUB format
- more quiz types and adaptive learning modes
- personalized learning progress
- spaced repetition quiz systems
Notes
- OpenAI-dependent features require a valid
.envfile withOPENAI_API_KEY. - The application does not expose API keys in code and should keep secrets outside version control.
Metadata
Release files for meso-shqip-ai 0.1.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| meso_shqip_ai-0.1.0.tar.gz | 18.6 kB | Without provenance | Details for meso_shqip_ai-0.1.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| meso_shqip_ai-0.1.0-py3-none-any.whl | Python 3 | none | any | Details for meso_shqip_ai-0.1.0-py3-none-any.whl |
Total release size: 33.2 kB
Release files / meso_shqip_ai-0.1.0.tar.gz
| Download URL | meso_shqip_ai-0.1.0.tar.gz |
|---|---|
| Size | 18.6 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
2992ca787e4b2a57c2d0d21ca125e6321a3b9beb9a69355bf929a5639b96aa8c
|
|
BLAKE2b-256 checksum How to use checksums |
af163712099cea1c08d93ca95dfd47802e1bcb4662d3d4148ebb7b199056c885
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Release files / meso_shqip_ai-0.1.0-py3-none-any.whl
| Download URL | meso_shqip_ai-0.1.0-py3-none-any.whl |
|---|---|
| Size | 14.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
7fdbe5d2ec8a4a3bcb61ad7a095d957c4fae82be0d12294aaad786162305cb78
|
|
BLAKE2b-256 checksum How to use checksums |
8b0c144fa77d5840b1b88a98590be8398d1941abc37c4da9cd5e6530ff3a009d
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/6.2.0 CPython/3.9.6
|
Security for meso-shqip-ai 0.1.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.