Skip to main content

python library for basic calculations.

Project description

basic_calcs 0.0.3

basic_calcs is a python library for basic calculations. It has no dependencies, just the standard library. It can run on almost any OS or python version.

[!WARNING] basic_calcs is still in alpha and has many missing features.

Installation

Install using this command:

pip install basic_calcs

Build from source

To build from source, first fork this repository and clone it. Then, install the developer dependencies:

pip install build setuptools

It is recommended to run this in a virtual environment. Then, to install it, run pip install .

[!NOTE] While developing, you might need to build it multiple times. For that, instead of pip install ., run pip install -e .. This installs basic_calcs in editable mode, meaning that you don't have to install it every time and it will automatically update when you edit a file.

Usage

Usage is very simple. Currently, there are only a few functions. Their usage is as follows:

from basic_calcs import *

add([10, 5])
# 15. add all the numbers you want to add in the list

subtract([10, 5])
# 5. add all the numbers you want to subtract in the list

multiply([10, 5])
# 50. add all the numbers you want to multiply in the list

divide(10, 5)
# 2

floor(10, 4)
# usually this would be 2.5 but in floor its rounded to 3

power(10, 2)
# 100

root(9, 2)
# 3

area_triangle(10, 2)
# 10

area_quad(10, 2)
# 20

area_circle(5)
# if radius is 5 then area is 78.57

area_polygon(2, 4)
# 4

Every function also has a verbose parameter which provides a more verbose answer. it defaults to False. Use it as follows:

from basic_calcs import add

add(5, 5, True) # it works the same for the rest of the functions
# 5 + 5 = 10

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

basic_calcs-0.0.3.tar.gz (3.8 kB view details)

Uploaded Source

Built Distribution

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

basic_calcs-0.0.3-py3-none-any.whl (4.2 kB view details)

Uploaded Python 3

File details

Details for the file basic_calcs-0.0.3.tar.gz.

File metadata

  • Download URL: basic_calcs-0.0.3.tar.gz
  • Upload date:
  • Size: 3.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for basic_calcs-0.0.3.tar.gz
Algorithm Hash digest
SHA256 6a25923caef521a8c443834da4840f546e15b3bd8215d2888f2b88af73fcee0f
MD5 f61d3ca9ff4916e6f00cfad03ed036e3
BLAKE2b-256 86178373f8cd222184cbac2228e7b95098f3e5109a34feaa08a04e26c7d1cbd9

See more details on using hashes here.

File details

Details for the file basic_calcs-0.0.3-py3-none-any.whl.

File metadata

  • Download URL: basic_calcs-0.0.3-py3-none-any.whl
  • Upload date:
  • Size: 4.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.3

File hashes

Hashes for basic_calcs-0.0.3-py3-none-any.whl
Algorithm Hash digest
SHA256 160c12305de3a469de5f81bde3cf27045c34c0bd9d8240b1f90214e36a871528
MD5 852bcb6901963e1f718a412aa1429a5b
BLAKE2b-256 4a028e0d7d39380c6651f3fb72dc503fd18e3eb823f126e28e5a683e670a9e0c

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