Skip to main content

An example of a package developed with pyenv, built with build using setuptools, uploaded to PyPI using twine, and distributed via pip.

Project description

Pyfarmsay

Badger

Expanding on the existing package, pycowsay, pyfarmsay does not only feature a talking cow, but an entire talking farm! Our beautiful farm features a talking cow, pig, chicken, dog, penguin, and sheep.

Install

To install our package on your local machine, run the following command:

pip install pyfarmsay 

To install into a virtual environment, make sure you install pipenv by running the following:

pip install pipenv

and then use the following command to install our package into an isolated virtual environment.

pipenv install pyfarmsay 

This will create a virtual environment, which you can access by running pipenv shell

Run

Once pyfarmsay is installed on your machine (or virtual environment), you can use it from the command line or from within a python file.

From the Command Line

To run the package from the command line, all you have to do is invoke the package name, followed by the animal of your choice and your desired message:

pyfarmsay [ANIMAL] [MESSAGE]

For example,

pyfarmsay cow i say moo

will output

 -----------
< i say moo >
 -----------
    \
     \
      ^__^
      (oo)\_______
      (__)\       )\/\
          ||----w |
          ||     ||

Import into a python module

Use the following import statement at the very top of your .py file to use the functions from within your module.

from pyfarmsay import pyfarmsay

or

from pyfarmsay.pyfarmsay import [function name]

Build and Test the package

To build and test our package for yourself, make sure to have pipenv installed.

Install our package into a virtual environment following the instructions above.

Run:

pipenv shell

Install build into the virtual environment using:

pip install build

Build the project using:

python3 -m build

To test, install pytest from the virtual environment shell using:

pip install pytest

Run unit tests using:

python3 -m pytest tests/test

Package functions

Pyfarmsay comes with the following 7 main functions, each accepting a message argument: Use the following command to run the program:

python3 ex_2.py [ANIMAL] [MESSAGE]
  1. cowsay (use cow for the animal argument if you are invoking the function from the command line)
  2. pigsay (use pig for the animal argument if you are invoking the function from the command line)
  3. chickensay (use chicken for the animal argument if you are invoking the function from the command line)
  4. sheepsay (use sheep for the animal argument if you are invoking the function from the command line)
  5. penguinsay (use penguin for the animal argument if you are invoking the function from the command line)
  6. dogsay (use dog for the animal argument if you are invoking the function from the command line)
  7. farmsay (use farm for the animal argument if you are invoking the function from the command line)

Our animals can only repeat what you tell them to say, so if no message is given, each animal will call out their native animal sound.

Authors

  1. Sarah Al-Towaity
  2. Harrison Douglass
  3. Brandon Chao
  4. Eduarda Martini
  5. Michelle Lu

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

pyfarmsay-0.1.3.tar.gz (42.9 kB view details)

Uploaded Source

Built Distribution

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

pyfarmsay-0.1.3-py3-none-any.whl (30.2 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: pyfarmsay-0.1.3.tar.gz
  • Upload date:
  • Size: 42.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for pyfarmsay-0.1.3.tar.gz
Algorithm Hash digest
SHA256 9b914f53cdb3fb0cd9f2aad4e3d5d0ac770900868dfd8a648874333c7cbb0979
MD5 6cd60f976648bc7aa1ca444939ee54c8
BLAKE2b-256 b94dc44cfa191b0472e1af180df4b162952ca65c9bd5f35d2c35fdcfc9797e62

See more details on using hashes here.

File details

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

File metadata

  • Download URL: pyfarmsay-0.1.3-py3-none-any.whl
  • Upload date:
  • Size: 30.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.1 CPython/3.8.5

File hashes

Hashes for pyfarmsay-0.1.3-py3-none-any.whl
Algorithm Hash digest
SHA256 3b87911bb28d8800ca56ee40d789a0369d6a1f673ebb225fd4f63de91697723d
MD5 d74878209e9ade31f830a16921c3af33
BLAKE2b-256 6a3d73c80b9b37bbaeeb7e3761005926f750f78d5a1f26cda976b25572574fb8

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