Skip to main content

A Python-based virtual pet simulation package with customizable care and stats tracking.

Project description

Pymagotchi

Workflow log

A Python-based virtual pet simulation package with customizable care and stats tracking.

Features

  • Feed your pet to keep it from getting hungry.
  • Play with your pet to keep it happy.
  • Rest your pet to give it energy.
  • Track your pet's stats (hunger, happiness, energy, and health).
  • Time-based simulation: Pet stats update over time, requiring regular care.

Links

Installation

Install pymagotchi via pip:

pip install pymagotchi

Usage

Once installed, you can run pymagotchi from the terminal to start the game.

python -m pymagotchi

Alternatively, you can create and interact with your pymagotchi pet within your python code.

from pymagotchi import Pet

# Create a new pet
my_pet = Pet.new_pet()

# Display the pet's stats
my_pet.status()

# Interact with the pet
my_pet.feed(amount=1)
my_pet.play(duration=5)
my_pet.sleep(duration=10)
my_pet.rename(new_name='new name')

# Display ascii representation of pet
my_pet.display()

Documentation

Pet Class

  • Pet(name=None, timeframe=DEFAULT_TIMEFRAME, immortal=False): Initializes a pet with a name, timeframe (rate of stat depletion), and immortality setting.
  • feed(amount): Increases the pet’s food level by the specified amount.
  • play(duration): Increases the pet’s happiness by the specified duration.
  • sleep(duration): Increases the pet’s sleep level by the specified duration.
  • rename(new_name): Changes the pet’s name to new_name.
  • update_stats(): Updates the pet’s stats based on time elapsed.
  • display_art(): Shows the pet’s mood as ASCII art.

generate_name()

  • Generates and returns a random pet name.

For more details, you can view the __main__.py file, which contains the full example code.

Pet Commands

  • Feed
  • Sleep
  • Play
  • Rename

Requirements

Python 3.7 or higher.

Contributing

To contribute to PyMagotchi:

  1. Clone the Repository:
git clone https://github.com/software-students-fall2024/3-python-package-book-of-amos-1.git
cd 3-python-package-book-of-amos-1
  1. Set Up a Virtual Environment: Use pipenv to set up the environment:
pipenv install --dev
pipenv shell
  1. Build and Test: Run the following to build and test the package:
python -m build
pipenv run pytest

Authors

Team : Book of Amos

Configuration and Setup Instructions

Run the Project

  1. Install Dependencies:
pip install pymagotchi 

or clone the repository and set up the development environment as shown above.

  1. Run the Interactive Pet Simulation:
pymagotchi

License

This project is licensed under the GNU General Public License. See the LICENSE file for details.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pymagotchi-1.0.0.tar.gz (45.6 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pymagotchi-1.0.0-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

Details for the file pymagotchi-1.0.0.tar.gz.

File metadata

  • Download URL: pymagotchi-1.0.0.tar.gz
  • Upload date:
  • Size: 45.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pymagotchi-1.0.0.tar.gz
Algorithm Hash digest
SHA256 2115681faa18e07d4e5cf54dfe766de310276f8e49921756ed1707d4940a80ee
MD5 5ad06a09d62ad37fbb61198899afd685
BLAKE2b-256 a17181a3900376cf3be8a3e65c6be0bbde9cc0388be4d295014cf15c56b46018

See more details on using hashes here.

File details

Details for the file pymagotchi-1.0.0-py3-none-any.whl.

File metadata

  • Download URL: pymagotchi-1.0.0-py3-none-any.whl
  • Upload date:
  • Size: 31.6 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/5.1.1 CPython/3.10.12

File hashes

Hashes for pymagotchi-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 f242e7909cba53dc1a56a73ced34946cf835e4bc9171c8bd309e5de976123f76
MD5 4afb7cc105622829f37015be0e4a5eea
BLAKE2b-256 f81f66f0df329fcfbd66b576a24b1f180ee5a6043fc3fe45ab4ecac0e50f174f

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page