PS: Most of this README was written by Claude Code.
Your friendly mathematical companion - a Tamagotchi-style desktop app that combines the charm of a virtual pet with mathematical enrichment!
- 🎭 Mood System: ASCII art character that changes expression based on time of day
- 📚 Math Problems: High-quality problems from Math StackExchange (analysis, real-analysis, etc.)
- 💭 Inspirational Quotes: Wisdom from legendary mathematicians
- ⏰ Time-Based Behavior: Different moods for morning, afternoon, evening, and night
- 🎨 Clean GUI: Simple, distraction-free PyQt6 interface
This project uses uv for fast, reliable Python package management.
- Python 3.10 or higher
- uv package manager
Install uv if you don't have it:
curl -LsSf https://astral.sh/uv/install.sh | sh- Clone or navigate to the project directory:
cd mathmagotchi- Create virtual environment and install dependencies:
uv venv
source .venv/bin/activate # On Windows: .venv\Scripts\activate
uv pip install -r pyproject.toml- Install development dependencies (optional, for type checking):
uv pip install -e ".[dev]"python main.pyOr with uv:
uv run python main.py- 📜 New Quote: Display a random mathematician quote
- 🧮 New Problem: Fetch a new math problem from Math StackExchange
Your Mathmagotchi changes mood based on the time of day:
- Morning (6-12): ☕ Energized - Ready for the day!
- Afternoon (12-18): 🤔 Pondering - Deep thinking mode
- Evening (18-22): 💭 Reflecting - Contemplative wisdom
- Night (22-6): 😴 Sleepy - Time to rest
Edit config.json to customize settings:
{
"timezone": "UTC",
"window_always_on_top": false,
"api_key": "",
"problem_difficulty": "medium",
"preferred_tags": ["analysis", "real-analysis"],
"window_width": 500,
"window_height": 600
}- timezone: Your timezone (e.g., "America/New_York", "Europe/London")
- window_always_on_top: Keep window above other windows
- api_key: Optional Stack Exchange API key for higher rate limits
- preferred_tags: Math topics to fetch problems from
- window_width/height: Window dimensions
Run mypy for type checking:
uv run mypy character.py quotes.py config.py mathstack.py gui.py main.pymathmagotchi/
├── main.py # Entry point
├── gui.py # PyQt6 GUI
├── character.py # ASCII art and mood system
├── mathstack.py # Math StackExchange API client
├── quotes.py # Quotes manager
├── config.py # Configuration handler
├── config.json # User settings (auto-generated)
├── data/
│ └── quotes.json # Mathematician quotes (auto-generated)
├── pyproject.toml # Project dependencies
└── requirements.txt # Legacy requirements file
Quotes are stored in data/quotes.json. The file is auto-generated on first run, but you can add more:
[
{
"author": "Mathematician Name",
"quote": "Inspiring quote here",
"era": "Time period"
}
]Edit character.py to modify or add new character moods. Each mood is a multi-line string in the MOODS dictionary.
The Math StackExchange API has rate limits:
- Without API key: 300 requests per day
- With API key: 10,000 requests per day
To get an API key:
- Register at Stack Apps
- Create an application
- Add the key to
config.json
Problem: "Could not fetch problem"
- Check your internet connection
- You may have hit the API rate limit (wait a few hours or add an API key)
- Try changing
preferred_tagsin config.json
Problem: Window is too small/large
- Resize the window and close the app - it will remember your preferred size
- Or edit
window_widthandwindow_heightin config.json
Problem: Character doesn't match time of day
- Check the
timezonesetting in config.json - Make sure your system time is correct