A Python package providing basic math operations and a sprinkle of humor with random math facts and jokes.
Project description
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.1/
Package Functions
- add(x, y):
Adds two numbers together. - subtract(x, y):
Subtracts the second number from the first. - multiply(x, y):
Multiplies two numbers. - divide(x, y):
Divides the first number by the second. Raises a ValueError for division by zero. - get_math_fact():
Returns a random fun math fact as a string. - 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
- Install
pipenv
pip install pipenv
- Install all dependencies from
Pipfile.lock
pipenv --python $(which python3) install
Or if you are using powershell:
pipenv --python $(where.exe python3) install
- Activate the virtual environment
pipenv shell
- Install the package
pipenv install -e .
- Run tests
pip install -U pytest
pytest
If the pytest shows ImportError, try to install python 3.8 and start from beginning
- Run an example program
python3 example.py
or
python example.py
- Tell a math joke, from the command line
tell_math_joke
- Get a math fact, from the command line
get_math_fact
Command Line Capability
Within the project directory,
- Type
tell_math_joke
into the command line to tell a math joke. - Type
get_math_fact
into the command line to give a 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
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
Hashes for math_randomseed-0.2.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 53745532c5feb547492d7c6b386358e751975521c1cbfb2408dd14f2e8d0326a |
|
MD5 | ce3a3d3c4d4209fcf5d7c51789d76053 |
|
BLAKE2b-256 | 2ac7c4b547608e4508348d79e7f12eef6d6c52f28cddf9e52f3ad6e13620a340 |