Skip to content

PyMaster: Advanced Python learning assistant by Matteo Panzeri. Interactive challenges, gamification, quests & arcade modes. Master Python concepts through hands-on coding exercises with real-time feedback. Windows-compatible terminal app using rich UI.

Notifications You must be signed in to change notification settings

matte1782/pymaster

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

7 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

πŸŽ“ PyMaster - Advanced Python Learning Assistant

β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•—   β–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—
β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β•šβ–ˆβ–ˆβ•— β–ˆβ–ˆβ•”β•β–ˆβ–ˆβ–ˆβ–ˆβ•— β–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•—β–ˆβ–ˆβ•”β•β•β•β•β•β•šβ•β•β–ˆβ–ˆβ•”β•β•β•
β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β•šβ–ˆβ–ˆβ–ˆβ–ˆβ•”β• β–ˆβ–ˆβ•”β–ˆβ–ˆβ–ˆβ–ˆβ•”β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•—   β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•”β•β•β•β•   β•šβ–ˆβ–ˆβ•”β•  β–ˆβ–ˆβ•‘β•šβ–ˆβ–ˆβ•”β•β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•”β•β•β–ˆβ–ˆβ•‘β•šβ•β•β•β•β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β–ˆβ–ˆβ•‘        β–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘ β•šβ•β• β–ˆβ–ˆβ•‘β–ˆβ–ˆβ•‘  β–ˆβ–ˆβ•‘β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ•‘   β–ˆβ–ˆβ•‘
β•šβ•β•        β•šβ•β•   β•šβ•β•     β•šβ•β•β•šβ•β•  β•šβ•β•β•šβ•β•β•β•β•β•β•   β•šβ•β•

An interactive Python learning platform with adaptive challenges, real-time feedback, and progress tracking

Python 3.10+ License: MIT Code style: black


image

✨ Features

  • 🧠 Adaptive Assessment - Smart quiz system that adjusts difficulty based on your performance
  • 🎯 Interactive Challenges - Hands-on coding exercises across multiple modules
  • πŸ“Š Real-time Analysis - Instant feedback on syntax, PEP8 compliance, and performance
  • πŸ† Achievement System - Earn badges for milestones and accomplishments
  • πŸ“ˆ Progress Tracking - Visual dashboard showing mastery levels across concepts
  • πŸ’‘ Smart Hints - Progressive hint system to guide you without spoiling solutions
  • πŸ“€ Export Reports - Generate detailed learning reports in Markdown, HTML, or PDF
  • πŸ”’ Safe Execution - Sandboxed code execution for security

πŸš€ Quick Start

Prerequisites

  • Python 3.10 or higher
  • pip package manager

Installation

  1. Clone the repository
git clone https://github.com/matte1782/pymaster.git
cd pymaster
  1. Create virtual environment (recommended)
python -m venv .venv

# Activate on macOS/Linux:
source .venv/bin/activate

# Activate on Windows (PowerShell):
.venv\Scripts\Activate.ps1
  1. Install dependencies
pip install -r requirements.txt
  1. Run PyMaster
python pymaster.py

πŸ“š Usage

First Time Setup

When you first run PyMaster, you'll be prompted for a username:

Enter your username [python_learner]: yourname

Main Menu

πŸŽ“ PyMaster - Advanced Python Learning
==================================================
1. πŸƒ Start Assessment
2. πŸ“š View Learning Path
3. 🎯 Practice Challenges
4. πŸ“Š Progress Dashboard
5. πŸ’‘ Show Hints
6. πŸ† Achievements
7. πŸ“€ Export Report
8. πŸšͺ Exit

Taking the Assessment

The assessment adapts to your skill level:

  • Answer questions correctly β†’ harder questions
  • Answer incorrectly β†’ easier questions
  • Determines your recommended starting level

Practice Challenges

  1. Select "Practice Challenges" from menu
  2. Read the challenge description and template
  3. Write your solution
  4. Type END on a new line to submit
  5. Get instant feedback on your code

Example Challenge Flow:

πŸš€ Challenge: List Comprehension Practice
Filter even numbers from a list and double them

πŸ“ Template Code:
[template shown...]

πŸ’» Enter your solution (type 'END' on a new line to finish):
def process_data(data):
    return [x * 2 for x in data if x % 2 == 0]
END

βœ… PASSED
πŸ“Š Code Quality Metrics:
  Syntax Validity: βœ…
  PEP8 Compliance: 95.0%
  Performance: 100.0%
  Execution Time: 0.0002s

Using Hints

During challenges, you can request hints:

  • Hints are revealed progressively
  • Each hint provides more specific guidance
  • Hints used count is tracked

Viewing Progress

The dashboard shows:

  • Mastery percentage for each concept
  • Visual progress bars
  • Module completion status
  • Recent activity

Earning Achievements

Unlock achievements by:

  • ✨ Completing your first challenge
  • 🎯 Perfect first-attempt passes
  • ⚑ Fast execution times
  • πŸ“ Perfect PEP8 scores
  • πŸ”₯ Maintaining learning streaks

Exporting Reports

Generate comprehensive reports including:

  • Overall progress summary
  • Mastery levels by module
  • Challenge statistics
  • Achievements earned
  • Personalized recommendations

Supported formats: Markdown (.md), HTML (.html), PDF (.pdf)

πŸ—οΈ Project Structure

pymaster/
β”œβ”€β”€ pymaster.py              # Main application
β”œβ”€β”€ requirements.txt         # Runtime dependencies
β”œβ”€β”€ requirements-dev.txt     # Development dependencies
β”œβ”€β”€ pytest.ini              # Pytest configuration
β”œβ”€β”€ .flake8                 # Flake8 configuration
β”œβ”€β”€ pymaster.db             # SQLite database (created on first run)
β”œβ”€β”€ reports/                # Generated reports directory
β”œβ”€β”€ tests/                  # Test suite
β”‚   β”œβ”€β”€ test_database.py
β”‚   β”œβ”€β”€ test_code_analyzer.py
β”‚   β”œβ”€β”€ test_challenges.py
β”‚   β”œβ”€β”€ test_performance.py
β”‚   β”œβ”€β”€ test_progress.py
β”‚   β”œβ”€β”€ test_achievements.py
β”‚   β”œβ”€β”€ test_export.py
β”‚   └── test_integration.py
└── docs/                   # Documentation
    β”œβ”€β”€ ARCHITECTURE.md
    β”œβ”€β”€ API.md
    β”œβ”€β”€ DATABASE.md
    β”œβ”€β”€ CHALLENGES.md
    └── DEPLOYMENT.md

πŸŽ“ Learning Modules

Available Modules

  1. Core Python - Functions, data types, control flow
  2. Data Structures - Lists, dicts, sets, comprehensions
  3. Object-Oriented Programming - Classes, inheritance, polymorphism
  4. Error Handling - Exceptions, try/except, custom exceptions
  5. File I/O - Reading/writing files, context managers
  6. Decorators - Function decorators, class decorators
  7. Concurrency - Threading, async/await
  8. Testing - Unit tests, pytest, TDD

πŸ§ͺ Development

Running Tests

# Run all tests
pytest

# Run with coverage
pytest --cov=. --cov-report=html

# Run specific test file
pytest tests/test_database.py

# Run with verbose output
pytest -v

Code Quality

# Format code
black .

# Lint code
flake8 .

# Type checking
mypy . --ignore-missing-imports

Adding New Challenges

See docs/CHALLENGES.md for detailed guide.

Quick example:

challenge = CorePythonChallenge(
    challenge_id="core_004",
    title="Your Challenge Title",
    description="Challenge description",
    difficulty=3,
    module="core_python",
    concept="your_concept"
)
challenge.add_test_case({'function': 'solution', 'args': [1, 2]}, 3)
challenge.add_hint("First hint")

πŸ”§ Configuration

Environment Variables

  • PYMASTER_DB_PATH - Custom database location (default: pymaster.db)
  • PYMASTER_SAFE_MODE - Enable strict sandboxing (true/false)
  • PYMASTER_TIMEOUT - Code execution timeout in seconds (default: 5)

Database Configuration

The SQLite database is created automatically. To use a custom location:

export PYMASTER_DB_PATH="/path/to/custom/database.db"
python pymaster.py

πŸ› Troubleshooting

Common Issues

Import Error: No module named 'rich'

pip install -r requirements.txt

Permission Error on Windows

  • Run PowerShell as Administrator
  • Or use: Set-ExecutionPolicy -ExecutionPolicy RemoteSigned -Scope CurrentUser

Database Lock Error

  • Close any other PyMaster instances
  • Delete pymaster.db-journal if it exists

Code Execution Timeout

  • Increase timeout: export PYMASTER_TIMEOUT=10
  • Check for infinite loops in your solution

Getting Help

🀝 Contributing

Contributions are welcome! Please read CONTRIBUTING.md for guidelines.

Ways to Contribute

  • πŸ› Report bugs
  • πŸ’‘ Suggest features
  • πŸ“ Improve documentation
  • ✨ Add new challenges
  • πŸ§ͺ Write tests
  • πŸ”§ Fix issues

πŸ“„ License

This project is licensed under the MIT License - see LICENSE file for details.

πŸ™ Acknowledgments

  • Built with Rich for beautiful terminal UI
  • Inspired by interactive learning platforms
  • Thanks to all contributors!

πŸ“Š Stats

  • 15+ Interactive Challenges
  • 8 Learning Modules
  • 10+ Achievement Badges
  • Comprehensive Progress Tracking

Made with ❀️ by Python learners, for Python learners

Getting Started β€’ Documentation β€’ Report Bug β€’ Request Feature

About

PyMaster: Advanced Python learning assistant by Matteo Panzeri. Interactive challenges, gamification, quests & arcade modes. Master Python concepts through hands-on coding exercises with real-time feedback. Windows-compatible terminal app using rich UI.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages