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.

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.1.0.tar.gz (48.3 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.1.0-py3-none-any.whl (32.9 kB view details)

Uploaded Python 3

File details

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

File metadata

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

File hashes

Hashes for pymagotchi-1.1.0.tar.gz
Algorithm Hash digest
SHA256 5b2a22068d5c215cdb12d8c8bc1e85c7d661f927cf140bc34af0bd66c15fb653
MD5 7e12bf8f90d521a27388b0370eab624f
BLAKE2b-256 fd1d916706a3592d9b5c2fd0f84179efbc69674f5e02c05c71efc54f924a958d

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymagotchi-1.1.0-py3-none-any.whl
  • Upload date:
  • Size: 32.9 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.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2d4f3b0893a69badf6997d2ffab39c1441e0a3318790596a6025a6182ef5970e
MD5 c8790856ef4faa28ca2a8b1e00105027
BLAKE2b-256 3b9da2fd5d417b89e528dffaf9c1fe12cf2e74dfff2971bc9e610a1e33b60a23

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