Skip to main content

A Python package providing basic math operations and a sprinkle of humor with random math facts and jokes.

Project description

Python CI

Python Package Exercise

The Math RandomSeed Python package is a lightweight library designed to bring a bit of fun to math operations. With simple addition, subtraction, multiplication, division functions, and quirky mathematical facts and jokes, the package is both entertaining and auxiliary. The project follows conventional software engineering practices with testing, proper packaging, and clear instructions for easy distribution. Documentation for all functions and instructions for installing are detailed below.

Group Members

Lara Kim
Andrew Huang
Ahmed Omar
Henry Wang

Python Package Link

https://pypi.org/project/math-randomseed/0.2.3/

Package Functions

  1. add(x, y):
    Adds two numbers together.
  2. subtract(x, y):
    Subtracts the second number from the first.
  3. multiply(x, y):
    Multiplies two numbers.
  4. divide(x, y):
    Divides the first number by the second. Raises a ValueError for division by zero.
  5. get_math_fact():
    Returns a random fun math fact as a string.
  6. tell_math_joke():
    Returns a math-themed joke as a string.

See example.py for, well, an example.

Setting up Virtual Env, Installing Dependencies, and Building and Testing

  1. Install pipenv
pip install pipenv 
  1. Install all dependencies from Pipfile.lock
pipenv --python $(which python3) install

Or if you are using powershell:

pipenv --python $(where.exe python3) install
  1. Activate the virtual environment
pipenv shell 
  1. Install the package
pipenv install -e . 
  1. Run tests
pip install -U pytest

pytest

If the pytest shows ImportError, try to install python 3.8 and start from beginning

  1. Run an example program
python3 example.py

or

python example.py
  1. Tell a math joke, from the command line
tell_math_joke
  1. Get a math fact, from the command line
get_math_fact

Installation and Usage

To install the most recent version of 'math-randomseed' as a PyPI package, simply run the following command in your terminal:

pip install math-randomseed --upgrade 

or

pip3 install math-randomseed --upgrade

To use 'math-randomseed' in your project, import the desired functions as follows:

from math_randomseed import add, subtract, multiply, divide, get_math_fact, tell_math_joke

Command Line Capability

  1. Type tell_math_joke into the command line to tell a math joke.
  2. Type get_math_fact into the command line to give a math fact.

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

math_randomseed-0.2.3.tar.gz (42.6 kB view hashes)

Uploaded Source

Built Distribution

math_randomseed-0.2.3-py3-none-any.whl (29.4 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