Skip to main content

A command line pet that you can feed, clean, and play with!

Project description

Python build & test

Python Package Exercise: Package Bear 🐻🐻‍❄️🐼

Package Description

Your own command line bear!

Team Members

Jasmine Fan https://github.com/jasmine7310

Sophia Wang https://github.com/s-m-wang

Tadelin De Leon https://github.com/TadelinD

Alex Wang https://github.com/alw9411

Contents

buildabear.py

Contains all functions used to initialize, interact, and play with bear.

change_name(temp)

change the name of the bear

  • Parameters: temp- the name to change the name of the bear into

  • Return: nothing

work(hours)

work a number of int hours to earn coins

  • Parameters: hours- int number of hours worked

  • Return: nothing

buy_food(amount)

buy a set amount of food

  • Parameters: amount- the int amount of food to buy

  • Return: nothing

feed_bear(amount)

feed an amount of food to the bear

  • Parameters: amount- the int amount of food to feed the bear

  • Return: nothing

Configuration

Before installing if you don't have pipenv:

pip install pipenv

Then activate pipenv:

pipenv shell

On a new python project run:

pip install buildabear-jasmine7310-s-m-wang-TadelinD-alw9411

PLEASE CREATE A DATA.TXT FILE AS SPECIFIED HERE BEFORE PROCEEDING!!!

First use the command below for the welcome message

python -m buildabearpackage

Then use the command below to initialize the package

python -m buildabearpackage start

Set Up Environment Variables and Starter Data

To use the package you are going to need to create a file called Data.txt in the same directory in which you will use the package.

In this txt file you will need to copy and paste the following:

happiness:100
hunger:100
cleanliness:100
food:10
budget:1000
name:Bear
initialized:False
lastChecked:0

Make sure that there is no new line after inputting this information.

Interacting with Pet

Once the Data.txt file is set up, you are ready to interact with your pet.

python -m buildabearpackage status
python -m buildabearpackage "change name"
python -m buildabearpackage work X  # X being an integer number!!
python -m buildabearpackage feed X # X being an interger number!!
python -m buildabearpackage clean
python -m buildabearpackage play
python -m buildabearpackage "buy food" X  # X being an integer number!!

Link to Our Package Page

Package Bear: buildabear

Project Contribution

Virtual Environment Setup

pip install pipenv
pipenv install pytest
pytest
pipenv shell

Uploading to Pypi using Twine

If there are *.egg-info and dist directories delete them before proceeding. Be sure to update version number.

pip install build twine
python -m build
twine upload dist/*

Example Usage

Link to Example Usage Markdown

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

Built Distribution

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

File details

Details for the file buildabear_jasmine7310_s_m_wang_tadelind_alw9411-0.1.6.tar.gz.

File metadata

File hashes

Hashes for buildabear_jasmine7310_s_m_wang_tadelind_alw9411-0.1.6.tar.gz
Algorithm Hash digest
SHA256 b21ae048d899fb899c1c4a93035fde3398fd43659dd2edeed945a5e5b8acdad2
MD5 fd6f8f15c323a0f1208d5d3ffb9580dc
BLAKE2b-256 d2f05e656f436b9958b3a9f17a979b25ff8a90fbf609aad91a95e18728515212

See more details on using hashes here.

File details

Details for the file buildabear_jasmine7310_s_m_wang_tadelind_alw9411-0.1.6-py3-none-any.whl.

File metadata

File hashes

Hashes for buildabear_jasmine7310_s_m_wang_tadelind_alw9411-0.1.6-py3-none-any.whl
Algorithm Hash digest
SHA256 06c9652e319068f299d8ea7b2c0c83ac63b8c2989de7690b39c98dbec2c39a8c
MD5 ad4a13fa7db850f87dfb1c4b52d671fa
BLAKE2b-256 ef872568ef50635da222a12858a906e0e076fc5f8deb22d2252e08090d4fdf86

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