adpkg

[!CAUTION]

UNMAINTAINED REPOSITORY

This project is no longer actively developed or maintained. It is kept public for historical purposes and reference.
Issues and Pull Requests will not be reviewed or merged. β€”

Advanced Math Utilities (adpkg)

Welcome! πŸ‘‹ This package gives you a bunch of handy tools for math, finance, and geometry in Python. You don’t need to be a math expertβ€”just import and use!

It includes modules for:

PyPI version Python License Downloads Last Commit Contributors


πŸ“‘ Table of Contents


πŸ“¦ Installation

Install from PyPI (make sure you have Python installed):

pip install adpkg

Check if it worked:

python -m pip show adpkg

πŸš€ Quick Start

Here are simple examples to get you started. More detailed examples are below.

from adpkg import finance, adcustom, triangle

# Calculate compound interest
print(finance.interest(1000, "1y", 12, 5))

# Factorial
print(adcustom.factorial(5))

# Reverse a string
print(adcustom.string_reverse("hello"))

# Area of a triangle
print(triangle.areaoftriangle(3, 4, 5))

πŸ’° Finance Module

interest(prime_amount, time_duration_str, n, rate)

from adpkg import finance
print(finance.interest(1000, "1y", 12, 5))   # 51.161
print(finance.interest(2000, "5y", 4, 7))   # 816.622

# Edge case: invalid input
print(finance.interest(1000, "abc", 12, 5))  # None

πŸ”’ AdCustom Module

Number Theory

check_prime(n) β†’ 1 if prime, 0 if not, None if invalid.

print(adcustom.check_prime(17))  # 1
print(adcustom.check_prime(10))  # 0

factorial(n)

print(adcustom.factorial(5))   # 120
print(adcustom.factorial(-2))  # None

permutation(n, r)

print(adcustom.permutation(5, 2))  # 20

combination(n, r)

print(adcustom.combination(5, 2))  # 10

Strings

string_reverse(s)

print(adcustom.string_reverse("hello"))  # "olleh"

Matrices

matrix_addition(a, b)

print(adcustom.matrix_addition([[1,2],[3,4]], [[5,6],[7,8]]))
# [[6,8],[10,12]]

matrix_multiplication(a, b)

print(adcustom.matrix_multiplication([[1,2],[3,4]], [[5,6],[7,8]]))
# [[19,22],[43,50]]

matrix_transpose(a)

print(adcustom.matrix_transpose([[1,2,3],[4,5,6]]))
# [[1,4],[2,5],[3,6]]

determinant_value(a)

print(adcustom.determinant_value([[1,2],[3,4]]))  # -2

Statistics

mean(data)

print(adcustom.mean([1,2,3,4,5]))  # 3.0

median(data)

print(adcustom.median([1,3,2,5,4]))  # 3

mode(data)

print(adcustom.mode([1,2,2,3,4,4,4,5]))  # ([4], 3)

πŸ”Ί Triangle Module

areaoftriangle(a, b, c, unit='')


πŸ§ͺ Running Tests

We included some test files (test1.py – test5.py).

Run one test:

python test1.py

Run all tests at once:

python -m unittest discover -s . -p "test*.py"

πŸ› οΈ Contributing

Want to help? Awesome! Here’s how:

  1. Fork this repo β†’ Make your own copy on GitHub.
  2. Create a branch β†’ Work on your changes in a separate branch.
  3. Add your code and tests β†’ Make sure it works!
  4. Open a Pull Request β†’ Propose your changes.

πŸ—ΊοΈ Roadmap


πŸ“œ License

This project is licensed under the MIT License - see the LICENSE file for details.


πŸ“¬ Contact

Author
Email
GitHub
PyPI
LinkedIn
Twitter
Instagram