Skip to main content

A fun Tamagotchi and pet simulation package!

Project description

Petmagotchi Package

Build Status

What is Petmagotchi?

Petmagotchi is a package that allows you to simulate taking care of your own virutal pet! Inspired by the Tamagotchi, you can create your own pet and interact with it in various ways. Take care of him/her by feeding, cleaning and playing with him!

Features

  • Create Your Pet: Choose from a variety of pet types and give it a name to start your journey together.
  • Feed Your Pet: Give an assortment of foods and drinks to your pet to keep their tummy full and hydrated.
  • Hygiene Maintenance: Clean your pet so they are ready for cuddles!
  • Playtime: Engage in fun activities with your pet to share a wonderful time together.

Installation

To install Petmagotchi, use the following pip command:

pip install petmagotchi

Functions and usage

Create a new python file and install petmagotchi. Then, import the package with the following line of code:

from petmagotchi.pet import Pet

Create Pet: Pet(name,type)

Create your pet instance with the following command: my_Pet = Pet(name = 'pet_name', type = 'type')

Any pet name is allowed, given that the pet name is a string.

The current version only supports two types of pets: Dog, Cat

Therefore, valid commands look like:

my_Pet = Pet(name = 'Yuka', type = 'Cat')
my_Pet = Pet(name = 'Kylo', type = 'Dog')

See the status of your pet: print_status()

To see the status of your pet, use the print_status() method. Example below:

my_Pet.print_status()

This will automatically update your pet status based on the the time since the last action, and show you the status of your pet.

Feed your pet: feed_pet(food, quantity)

To feed your pet, use the feed_pet(food,quantity) method. This will fill your pet's hunger meter and mood. The method will also print out a reaction!

  • The valid food selections are: meat, vegetable, ice cream, bread
  • The valid quantity range is: [1,3]

Example below:

my_Pet.feed_pet(food = 'meat', quantity = 2)

Hydrate your pet: hydrate_pet(drink, quantity)

Same as feed, but for drinks!

  • The valid food selections are: water, soda, milk, lemonade
  • The valid quantity range is: [1,3]

Example below:

my_Pet.feed_pet(drink = 'lemonade', quantity = 3)

Play with your pet: play(toy)

Play with your pet by giving it a toy. This will consume some energy but raise their mood. Pets also have a favorite toy!

  • The valid toy selections are: yarn, ball, plushie, bone
  • Pets that have low energy will be too tired to play

Example below:

my_Pet.play(toy = 'plushie')

Keep your pet clean: wash()

Keep your pet clean by washing him with:

my_Pet.wash()

Pet your pet: pet()

Pet your pet with:

my_Pet.pet()

A pet that is too unhappy may not be willing to come for pets. Keep them happy by playing with them!

Bring them somewhere: bring_to(destination)

Take your pet somewhere fun!

You can take them to the park, on a hike, to the vet, to the groomer, or lastly to a pet cafe.

my_Pet.bring_to('park')

Save your pet: save_pet()

Save your pet for the future!

my_Pet.save_pet()

The file will automatically be called petName.pickle, where petName will be the name of your pet, with underscores representing spaces.

Load your pet: load_pet(file_path)

Load a previous pet:

my_Pet = Pet.load_pet(file_path = 'Fido.pickle')

Ensure to enter the file name correctly!

Example file

To see an example file with the above methods, click here.

Contributing to the package

Feel free to contribute to the project! Here are the steps you can take to contribute.

Fork the repository

Fork the repository to your own account by visiting our GitHub page.

Clone the repository to your local computer

Use Git Bash or something similar to clone the repository to your local computer. The command for Git Bash is:

git clone ...

Where you replace ... with the url of the repository.

Set up your Development Environment

  1. Open a terminal with python.
  2. If you do not have pipenv, install the package with the command:
pip install pipenv
  1. Once pipenv is installed, install the package dependencies by running:
pipenv install --dev

To activate the virtual environment, run:

pipenv shell

You can now write your code to contribute to the project.

Rest of the workflow: branch creation, creating a PR

Create your own feature branch, then add and commit your changes. Once that is completed, feel free to create a pull request to the main repository.

We will review the changes as soon as possible!

Other notes

  • Make sure to add and run additional unit tests for newly written functions in /src/tests.
  • Add documentation to the README.md for new functions.

You can run tests in the terminal with the command: pipenv run pytest

PyPi link!

To access our package on PyPi, click here!

Contributors

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

petmagotchi-0.1.4.tar.gz (51.4 kB view hashes)

Uploaded Source

Built Distribution

petmagotchi-0.1.4-py3-none-any.whl (33.3 kB view hashes)

Uploaded Python 3

Supported by

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