Skip to main content

Python Package Exercise

log github events

Team members

Deniz Qian: https://github.com/dq2024
Somyung Kim: https://github.com/troy-skim
Terrance Chen: https://github.com/tchen0125
Kim Young: https://github.com/Kyoung655

Project Description

This project is a calculator app that is able to execute multiple functions. The availible functions are add, subtract, multiply, divide, mod, log, exp, randomnumsrange, stringParse, abs, factorial, mean, median, and mode.

Project Instructions

Pipenv Installation:

Ensure pipenv is installed: if not:

pip install pipenv

Integration of project into your existing code

If you want to integrate our project code into your code, you can do so by...

Installation

You can install calculator project by using pip:

pipenv install CalculatorPackSEDTTT==1.0.3

Install Dependecies if needed:

pipenv install

Usage

To use it in your code, please import functions needed

from calc import add, subtract, multiply, divide, mod, stringParse, log, exp, abs, factorial, mean, median, mode, randomnumsrange, cubesurfacearea

Below is documentation for methods to be used in code

Documentation of out project's functions

Our project has the following functions: add(x,y): this functions takes two numbers, adds them together, then returns their sum. This function is only to be used within the stringParse() function. Example here:

substract(x,y): this functions takes two numbers, subtracts them from eachother, then returns their difference. This function is only to be used within the stringParse() function. Example here:

multiply(x,y): this functions takes two numbers, multiplies them together, then returns their product. This function is only to be used within the stringParse() function. Example here:

divide(x,y): this functions takes two numbers, divides them by eachother, then returns their quotient. This function is only to be used within the stringParse() function. Example here:

mod(x,y): this functions takes two numbers, calls the modulus operator, then returns the remainder. This function is only to be used within the stringParse() function. Example here:

log(x,y): this functions takes two numbers, adds them together, then returns the natural logarithm. This function is only to be used within the stringParse() function. Example here:

exp(x,y): this functions takes two numbers. x is multiplied by itself y times. The code then returns the product. This function is only to be used within the stringParse() function. Example here:

randomnumsrange(x,y): this functions takes two numbers. random numbers are generated in between 0 and x, y times. The code then returns the list of random number generated. This function is only to be used within the stringParse() function. Example here:

stringParse(input): this function takes two numbers and any of the following functions previously mentioned: add, subtract, multiply, divide, mod, log, exp, and randomnumsrange. The format for stringParse(input) must be stringParse("number1 operation number2"). Examples here:

abs(x): this function takes a single number and converts it into its absolute value. Example here:

factorial(x, val = {}): this function takes in a number and returns its factorial value. Example here:

mean(list): this function takes in a list of numbers, sums them up, then divides them by the number of numbers in the array, returning the average. Example here:

median(list): this function takes in a list of numbers, ordering the data points, and then finding the midddle number or taking the mean of the middle two numbers. Example here:

mode(numbers): this function takes in a list of numbers and returns the number that appears most often. Example here:

cubesurfacearea(x): this function takes in a number, calls our exp function with x, then multiplies the value returned by our exp function by 6 to get the surface area of a cube.

Example Usage

Please look at example.py

Contribution

Create a fork then clone:

git clone https://github.com/software-students-spring2024/3-python-package-exercise-team-dtttt.git

Ensure pipenv is installed according to above instructions

Start Virtual Environment:

pipenv shell

Dependecies:

pipenv install

Build

Ensure Build is installed if not:

pipenv install build

Run:

python -m build

on Windows

python3 -m build

on Mac

Running Tests

pytest

pytest will run the tests you can add more to tests under tests

To modify functions in calculator please view calc folder with calculator.py

Commit

Please commit to a feature branch and submit a merge request for any edits

(PyPI)[https://pypi.org/project/CalculatorPackSEDTTT/1.0.3/]

Metadata

Release files for CalculatorPackSEDTTT 1.0.3

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for CalculatorPackSEDTTT 1.0.3
File Size Uploaded Provenance Actions
CalculatorPackSEDTTT-1.0.3.tar.gz 19.1 kB Without provenance Details for CalculatorPackSEDTTT-1.0.3.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for CalculatorPackSEDTTT 1.0.3
File Interpreter ABI Platform Actions
CalculatorPackSEDTTT-1.0.3-py3-none-any.whl Python 3 none any Details for CalculatorPackSEDTTT-1.0.3-py3-none-any.whl

Total release size: 37.5 kB

Release files / CalculatorPackSEDTTT-1.0.3.tar.gz

Download URL CalculatorPackSEDTTT-1.0.3.tar.gz
Size 19.1 kB
Tags Source
SHA-256 checksum
How to use checksums
c2d6393ec3767b6d68cedb8ad152a237dd68fa5a1340c5da63230acbe6fa8de6
BLAKE2b-256 checksum
How to use checksums
cfc7ec9e536d825c55d03d9eff1ff0ef52c5fef4c2a4ac72e27e34a7d3ce6501
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.9

Release files / CalculatorPackSEDTTT-1.0.3-py3-none-any.whl

Download URL CalculatorPackSEDTTT-1.0.3-py3-none-any.whl
Size 18.3 kB
Tags Python 3
SHA-256 checksum
How to use checksums
519e6d0c40046fc7c916cf7abfb67afdc758345838cb3432c9521589909c3590
BLAKE2b-256 checksum
How to use checksums
02421dc705f4c986fcc9e7f789cd29d5644b1b8c97cd809a5388eae7839f761b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/5.0.0 CPython/3.8.9

Security for CalculatorPackSEDTTT 1.0.3

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page