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 details)

Uploaded Source

Built Distribution

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

math_randomseed-0.2.3-py3-none-any.whl (29.4 kB view details)

Uploaded Python 3

File details

Details for the file math_randomseed-0.2.3.tar.gz.

File metadata

  • Download URL: math_randomseed-0.2.3.tar.gz
  • Upload date:
  • Size: 42.6 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.2

File hashes

Hashes for math_randomseed-0.2.3.tar.gz
Algorithm Hash digest
SHA256 2a1bc44154b9c4386fe063ce6899e68f3653c8b754c740179927f5301c4e707b
MD5 0f3fe79301e5b0de884510da26e7acdf
BLAKE2b-256 92a1e9ca72180298617c9828c268e9a986eaa11a6f8e93cb3da48eb55c17b872

See more details on using hashes here.

File details

Details for the file math_randomseed-0.2.3-py3-none-any.whl.

File metadata

File hashes

Hashes for math_randomseed-0.2.3-py3-none-any.whl
Algorithm Hash digest
SHA256 e248b7165433056c1b80e7db6226febf6a2d4f38e526772c4353befb15e380dd
MD5 cdc62ab7744fb6309e1ada6af2f97c4a
BLAKE2b-256 9436160a43da9134b0024961c900bf5ef9c2afdf3e370435550376b41305f8cb

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