python library for basic calculations.
Project description
basic_calcs
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_calcsis 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. After this, run python -m build to build the wheels and tarball. Then, to install it, run pip install .
[!NOTE] While developing, you might need to build it multiple times. For that, instead of
pip install ., runpip install -e .. This installsbasic_calcsin 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, subtract, multiply, divide, floor, power, root
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
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
Release history Release notifications | RSS feed
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
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file basic_calcs-0.0.2.tar.gz.
File metadata
- Download URL: basic_calcs-0.0.2.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
54f015e5b3ab37ac906013f6498309fd8d74116723b6f54761d202257597493d
|
|
| MD5 |
2e1efb737ae3f67072af6466ed129a4e
|
|
| BLAKE2b-256 |
6cd808f68a6166cd5016304000066f103ab2400a3644843aa4f9bbe9721e7ae5
|
File details
Details for the file basic_calcs-0.0.2-py3-none-any.whl.
File metadata
- Download URL: basic_calcs-0.0.2-py3-none-any.whl
- Upload date:
- Size: 3.7 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.3
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
d8666d3c69fd22b07bc3a4c3c036b2c93afd78451c57046a9544600276a23216
|
|
| MD5 |
ee767cde97df891c69808a4c1a4a6a7d
|
|
| BLAKE2b-256 |
92d85a5a48bb296a63eee2ea878bd2e206e61a0e447d4f5649cde23ca19148b1
|