A Python package to gamify your study sessions by raising a virtual ball python
Project description
๐ SsstudyPet
SsstudyPet is a Python package that provides an interactive command-line application to gamify your study sessions by letting you raise and care for a virtual ball python. The more you study, the more your snake grows! Track your study time, earn coins, feed your python, and watch it level up as you build consistent study habits.
Features
- ๐ Study Session Tracking: Start and end study sessions with automatic time tracking
- โ Task-Based Rewards: Set tasks at the start of each session and earn 75 coins per completed task
- ๐ Virtual Ball Python: Your snake levels up based on total study hours (1 level per 5 hours)
- ๐ก๏ธ Mood System: Keep your python happy by logging in regularly and feeding it
- ๐ฐ Earn Coins: Complete tasks to earn coins that can be used to purchase food for your python
- ๐ญ Feed Your Python: Choose from various prey (mouse, rat, quail, rabbit, cricket) to boost mood
- ๐ Progress Tracking: Monitor your study streaks, total study time, and python status
- ๐ Auto-save: Sessions automatically save on exit or interruption
- ๐ฎ Interactive Menu: Easy-to-use CLI menu for all features
Team Members
Installation
Install from PyPI:
pip install ssstudy-pet
Or install from source:
git clone https://github.com/swe-students-fall2025/3-python-package-team_cascade.git
cd team_cascade
pipenv install --dev
Examples
Want to see SsstudyPet in action? We provide two complete demo options:
๐ Option 1: Interactive Jupyter Notebook
Perfect for visual learners and live demonstrations!
Location: notebook_demo.ipynb
Features:
- Step-by-step walkthrough of all features
- Live code examples you can run and modify
- Mock input functions for smooth demo flow
- Complete demonstration of study sessions, feeding, customization, and more
To run:
# Install Jupyter if you haven't already
pip install jupyter
# Open the demo notebook
jupyter notebook notebook_demo.ipynb
๐ Option 2: Python Script Demo
Complete Python program you can run from the command line!
Location: full_program_demo.py
Features:
- Full demonstration of all SsstudyPet functions
- Shows study sessions, task tracking, rewards, feeding, and customization
- Easy to read and modify for your own use
- No Jupyter required - just run with Python
To run:
python full_program_demo.py
๐ป Using SsstudyPet in Your Code
You can import and use SsstudyPet's functions in your own Python programs. Here's documentation for all available functions:
Study Session Management
from study_pet.tracker import start_session, end_session, show_encouragement
# Start a study session with task planning
start_session()
# Prompts: "How many tasks do you plan to complete this session?"
# Sets session_tasks_planned and records start time
# Automatically shows an encouragement message to motivate you
# End a study session with task completion
end_session()
# Prompts: "How many tasks did you complete this session?"
# Rewards 75 coins per completed task
# Updates total study time and saves progress
# Automatically shows a congratulatory encouragement message
# Get encouragement during an active study session
show_encouragement()
# Shows elapsed study time and a motivational message
# Only works during an active session (after start_session, before end_session)
# Example output:
# โฑ๏ธ You've been studying for 15.3 minutes!
# ๐ Monty says: "Sssstay focused! You're on a roll!"
Pet Care Functions
from study_pet.pet import feed_pet, rename_pet, set_morph, get_encouragement
# Feed your ball python (costs coins, boosts mood)
feed_pet("mouse") # Costs 50 coins, +10 mood
# ... (rest of feed_pet examples) ...
# Rename your ball python
rename_pet("Slithers")
# Set your ball python's morph (color pattern)
set_morph("Banana")
# ... (rest of set_morph examples) ...
# Get an encouraging phrase from your pet
encouragement = get_encouragement()
print(encouragement) # Outputs: ๐ Guido says: "Sssstay focused!"
# Get your ball python's current status
status = get_status()
print(status) # Returns formatted status string
Status and Data Functions
from study_pet.pet import get_status
from study_pet.data_manager import load_state, save_state, reset_data
# Get your ball python's current status
status = get_status()
print(status) # Returns formatted status string with all pet info
# Load current saved data
state = load_state()
print(f"Level: {state['level']}")
print(f"Coins: {state['coins']}")
print(f"Morph: {state['morph']}")
# Manually save data (normally done automatically)
save_state(state)
# Reset all data (use with caution!)
reset_data()
Example Programs
We provide two example options:
- ๐ Interactive Demo Notebook (
notebook_demo.ipynb) - Jupyter notebook with step-by-step demonstrations - ๐ Python Script (
full_program_demo.py) - Complete Python program showcasing all functions
# full_program_demo.py - Complete demonstration of SsstudyPet
from study_pet.tracker import start_session, end_session
from study_pet.pet import feed_pet, rename_pet, set_morph, get_status, get_encouragement
from study_pet.data_manager import load_state
# Start a study session
print("Starting study session...")
start_session() # Will prompt for task count
# Do some studying... (simulated)
print("\n๐ Studying...\n")
# End the session and earn rewards
end_session() # Will prompt for completed tasks
# Get encouragement
print("\n" + get_encouragement())
# Check your ball python's status
print("\n" + get_status())
# Name your python
rename_pet("Monty")
print("\n๐ Your ball python is now named Monty!")
# Set a morph
set_morph("Banana")
print("\nโจ Your python is now a beautiful Banana morph!")
# Feed your python
feed_pet("mouse")
print("\n๐ญ Fed your python a mouse!")
# Check final status
print("\n" + get_status())
# Access raw data
state = load_state()
print(f"\n๐ฐ Total coins: {state['coins']}")
print(f"โฑ๏ธ Total study time: {state['total_minutes']} minutes")
Command Line Usage
Quick Start Commands
# Start a study session (automatic encouragement!)
study-pet start
# Get encouragement during your session
study-pet encourage
# End your session (automatic congratulation!)
study-pet end
# Check your pet's status
study-pet status
# Feed your pet
study-pet feed mouse
# Interactive menu
study-pet menu
All Available Commands
study-pet start- Start a study session with task planningstudy-pet end- End session and get rewardsstudy-pet status- Check your ball python's statusstudy-pet feed [food]- Feed your python (mouse, rat, quail, rabbit, cricket)study-pet rename [name]- Rename your ball pythonstudy-pet morph [type]- Change your python's morph/color patternstudy-pet encourage- Get an encouraging message (during active session)study-pet menu- Interactive menu interface
Contributing to SsstudyPet
Want to help make SsstudyPet better? Here's how to set up your development environment:
Prerequisites
- Python 3.10 or higher (Python 3.13 recommended)
- pipenv for dependency management
Setup Instructions
-
Clone the repository
git clone https://github.com/swe-students-fall2025/3-python-package-team_cascade.git cd 3-python-package-team_cascade-4
-
Install pipenv (if not already installed)
pip install pipenv
-
Set up the virtual environment and install dependencies
# Install all dependencies including dev dependencies pipenv install --dev # This installs: # - pytest (for testing) # - build (for building the package) # - twine (for publishing to PyPI)
-
Activate the virtual environment
pipenv shell -
Run the tests
# Run all tests pytest tests/ -v # Run tests with coverage pytest tests/ --cov=study_pet --cov-report=html # Run specific test file pytest tests/test_actions.py -v
-
Build the package
# Build distribution files python -m build # This creates dist/ directory with: # - .tar.gz (source distribution) # - .whl (wheel distribution)
-
Test the package locally
# Install in editable mode for development pip install -e . # Run the CLI study-pet menu
Development Workflow
-
Create a new feature branch:
git checkout -b feature/your-feature-name
-
Make your changes and test thoroughly:
pytest tests/ -v
-
Commit your changes:
git add . git commit -m "Add your descriptive commit message"
-
Push to GitHub and create a pull request:
git push origin feature/your-feature-name
-
Wait for CI tests to pass (GitHub Actions automatically runs tests)
Project Structure
study_pet/
โโโ __init__.py # Package initialization
โโโ __main__.py # CLI entry point
โโโ data_manager.py # Data persistence functions
โโโ tracker.py # Study session tracking
โโโ pet/
โโโ __init__.py # Pet module exports
โโโ core.py # Pet status and leveling
โโโ actions.py # Pet interaction functions
tests/
โโโ test_actions.py # Tests for pet actions
โโโ test_core.py # Tests for pet core functions
โโโ test_data_manager.py # Tests for data management
โโโ test_tracker.py # Tests for session tracking
โโโ test_main.py # Tests for CLI commands
โโโ test_morph.py # Tests for morph system
Running Specific Tests
# Test specific functionality
pytest tests/test_morph.py::test_set_morph_valid -v
pytest tests/test_tracker.py -v
pytest tests/test_actions.py::test_feed_pet -v
# Test with output
pytest tests/ -v -s
# Generate coverage report
pytest tests/ --cov=study_pet --cov-report=term-missing
PyPI Package
This package is available on TestPyPI: study-pet
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file study_pet-0.1.0.tar.gz.
File metadata
- Download URL: study_pet-0.1.0.tar.gz
- Upload date:
- Size: 33.4 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eab0b763000893fba9fcd9081c28e87c98886c2f532f11b424ce93fcec72e997
|
|
| MD5 |
d7fe0f0354e2461b2445836278f15fb6
|
|
| BLAKE2b-256 |
3fc969e94b65dd272dade47658dbe96cd08f47474a75822e56c7dcfd667e09a2
|
File details
Details for the file study_pet-0.1.0-py3-none-any.whl.
File metadata
- Download URL: study_pet-0.1.0-py3-none-any.whl
- Upload date:
- Size: 27.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.4
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
6477850044a218221d2ab9bff8aeb5ad6443f453f756d76e847b448e9618de13
|
|
| MD5 |
36b902518e04745a940413d2a355e048
|
|
| BLAKE2b-256 |
0c946d9f491085574372d48c6cf37d514a76fb808a746e572e28623b36cfba70
|