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-0.1.3.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-0.1.3-py3-none-any.whl (31.6 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pymagotchi-0.1.3.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-0.1.3.tar.gz
Algorithm Hash digest
SHA256 2e04d7040c1ae13800835c969254e2b2adf69afc37e73c3d41fefc4ff2870157
MD5 2724660e1ac65de97e13b5ecce8bb6bd
BLAKE2b-256 6b404927b06f9bf195e2d97ec84941878f829f5a83ada1a3d655109e8b33803f

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pymagotchi-0.1.3-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-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 12f881b2799abd587494aa602a37ee6870d16d72ae529d95b92eaf7566cd5435
MD5 ff3a192dbe99b65a4170105bdbc6b6fa
BLAKE2b-256 b376435041b12541868b4cbbc70a2c3aa55a9edd294ec26b1bbb9586f69998be

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