adpkg

A package containing Python mo...
Log | Files | Refs | README | LICENSE

README.md (6679B)


      1 > [!CAUTION]
      2 > ## UNMAINTAINED REPOSITORY
      3 >
      4 > This project is no longer actively developed or maintained. It is kept public for historical purposes and reference. <br>
      5 > ***Issues and Pull Requests will not be reviewed or merged.***
      6 ---
      7 
      8 # Advanced Math Utilities (adpkg)
      9 
     10 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!
     11 
     12 It includes modules for:
     13 - **Finance**: Calculate compound interest easily
     14 - **Number Theory**: Check primes, factorials, permutations and combinations
     15 - **Strings**: Reverse words or phrases
     16 - **Matrices**: Add, multiply, transpose, and find determinants
     17 - **Statistics**: Mean, median, mode
     18 - **Geometry**: Triangle area with Heron’s formula
     19 
     20 [![PyPI version](https://img.shields.io/pypi/v/adpkg.svg)](https://pypi.org/project/adpkg/)
     21 [![Python](https://img.shields.io/pypi/pyversions/adpkg.svg)](https://pypi.org/project/adpkg/)
     22 [![License](https://img.shields.io/github/license/notamitgamer/adpkg)](https://github.com/notamitgamer/adpkg/blob/main/LICENSE)
     23 [![Downloads](https://pepy.tech/badge/adpkg)](https://pepy.tech/project/adpkg)
     24 [![Last Commit](https://img.shields.io/github/last-commit/notamitgamer/adpkg)](https://github.com/notamitgamer/adpkg/commits/main)
     25 [![Contributors](https://img.shields.io/github/contributors/notamitgamer/adpkg)](https://github.com/notamitgamer/adpkg/graphs/contributors)
     26 
     27 ---
     28 
     29 ## πŸ“‘ Table of Contents
     30 - [πŸ“¦ Installation](#-installation)
     31 - [πŸš€ Quick Start](#-quick-start)
     32 - [πŸ’° Finance Module](#-finance-module)
     33   - [interest](#interestprime_amount-time_duration_str-n-rate)
     34 - [πŸ”’ AdCustom Module](#-adcustom-module)
     35   - [Number Theory](#number-theory)
     36     - [check_prime](#check_primen)
     37     - [factorial](#factorialn)
     38     - [permutation](#permutationn-r)
     39     - [combination](#combinationn-r)
     40   - [Strings](#strings)
     41     - [string_reverse](#string_reverses)
     42   - [Matrices](#matrices)
     43     - [matrix_addition](#matrix_additiona-b)
     44     - [matrix_multiplication](#matrix_multiplicationa-b)
     45     - [matrix_transpose](#matrix_transposea)
     46     - [determinant_value](#determinant_valuea)
     47   - [Statistics](#statistics)
     48     - [mean](#meandata)
     49     - [median](#mediandata)
     50     - [mode](#modedata)
     51 - [πŸ”Ί Triangle Module](#-triangle-module)
     52   - [areaoftriangle](#areaoftrianglea-b-c-unit)
     53 - [πŸ§ͺ Running Tests](#-running-tests)
     54 - [πŸ› οΈ Contributing](#-contributing)
     55 - [πŸ—ΊοΈ Roadmap](#-roadmap)
     56 - [πŸ“œ License](#-license)
     57 
     58 ---
     59 
     60 ## πŸ“¦ Installation
     61 
     62 Install from PyPI (make sure you have Python installed):
     63 ```bash
     64 pip install adpkg
     65 ```
     66 
     67 Check if it worked:
     68 ```bash
     69 python -m pip show adpkg
     70 ```
     71 
     72 ---
     73 
     74 ## πŸš€ Quick Start
     75 
     76 Here are simple examples to get you started. More detailed examples are below.
     77 
     78 ```python
     79 from adpkg import finance, adcustom, triangle
     80 
     81 # Calculate compound interest
     82 print(finance.interest(1000, "1y", 12, 5))
     83 
     84 # Factorial
     85 print(adcustom.factorial(5))
     86 
     87 # Reverse a string
     88 print(adcustom.string_reverse("hello"))
     89 
     90 # Area of a triangle
     91 print(triangle.areaoftriangle(3, 4, 5))
     92 ```
     93 
     94 ---
     95 
     96 ## πŸ’° Finance Module
     97 
     98 ### `interest(prime_amount, time_duration_str, n, rate)`
     99 - Calculates compound interest based on years/months.
    100 - Duration formats: `"2y"`, `"6m"`, or `"1y6m"`.
    101 
    102 ```python
    103 from adpkg import finance
    104 print(finance.interest(1000, "1y", 12, 5))   # 51.161
    105 print(finance.interest(2000, "5y", 4, 7))   # 816.622
    106 
    107 # Edge case: invalid input
    108 print(finance.interest(1000, "abc", 12, 5))  # None
    109 ```
    110 
    111 ---
    112 
    113 ## πŸ”’ AdCustom Module
    114 
    115 ### Number Theory
    116 
    117 #### `check_prime(n)` β†’ 1 if prime, 0 if not, None if invalid.
    118 ```python
    119 print(adcustom.check_prime(17))  # 1
    120 print(adcustom.check_prime(10))  # 0
    121 ```
    122 
    123 #### `factorial(n)`
    124 ```python
    125 print(adcustom.factorial(5))   # 120
    126 print(adcustom.factorial(-2))  # None
    127 ```
    128 
    129 #### `permutation(n, r)`
    130 ```python
    131 print(adcustom.permutation(5, 2))  # 20
    132 ```
    133 
    134 #### `combination(n, r)`
    135 ```python
    136 print(adcustom.combination(5, 2))  # 10
    137 ```
    138 
    139 ### Strings
    140 
    141 #### `string_reverse(s)`
    142 ```python
    143 print(adcustom.string_reverse("hello"))  # "olleh"
    144 ```
    145 
    146 ### Matrices
    147 
    148 #### `matrix_addition(a, b)`
    149 ```python
    150 print(adcustom.matrix_addition([[1,2],[3,4]], [[5,6],[7,8]]))
    151 # [[6,8],[10,12]]
    152 ```
    153 
    154 #### `matrix_multiplication(a, b)`
    155 ```python
    156 print(adcustom.matrix_multiplication([[1,2],[3,4]], [[5,6],[7,8]]))
    157 # [[19,22],[43,50]]
    158 ```
    159 
    160 #### `matrix_transpose(a)`
    161 ```python
    162 print(adcustom.matrix_transpose([[1,2,3],[4,5,6]]))
    163 # [[1,4],[2,5],[3,6]]
    164 ```
    165 
    166 #### `determinant_value(a)`
    167 ```python
    168 print(adcustom.determinant_value([[1,2],[3,4]]))  # -2
    169 ```
    170 
    171 ### Statistics
    172 
    173 #### `mean(data)`
    174 ```python
    175 print(adcustom.mean([1,2,3,4,5]))  # 3.0
    176 ```
    177 
    178 #### `median(data)`
    179 ```python
    180 print(adcustom.median([1,3,2,5,4]))  # 3
    181 ```
    182 
    183 #### `mode(data)`
    184 ```python
    185 print(adcustom.mode([1,2,2,3,4,4,4,5]))  # ([4], 3)
    186 ```
    187 
    188 ---
    189 
    190 ## πŸ”Ί Triangle Module
    191 
    192 ### `areaoftriangle(a, b, c, unit='')`
    193 - Uses Heron’s formula.
    194 ```python
    195 print(triangle.areaoftriangle(3, 4, 5))           # 6.0
    196 print(triangle.areaoftriangle(3, 4, 5, "sq cm")) # "6.0 sq cm"
    197 ```
    198 
    199 ---
    200 
    201 ## πŸ§ͺ Running Tests
    202 
    203 We included some test files (`test1.py` – `test5.py`).
    204 
    205 Run one test:
    206 ```bash
    207 python test1.py
    208 ```
    209 
    210 Run all tests at once:
    211 ```bash
    212 python -m unittest discover -s . -p "test*.py"
    213 ```
    214 
    215 ---
    216 ## πŸ› οΈ Contributing
    217 
    218 Want to help? Awesome! Here’s how:
    219 1. **Fork this repo** β†’ Make your own copy on GitHub.
    220 2. **Create a branch** β†’ Work on your changes in a separate branch.
    221 3. **Add your code and tests** β†’ Make sure it works!
    222 4. **Open a Pull Request** β†’ Propose your changes.
    223 
    224 ---
    225 
    226 ## πŸ—ΊοΈ Roadmap
    227 - βœ… Current: Finance, number theory, strings, matrices, stats, triangles
    228 - πŸ”œ Next: Probability, calculus, polynomials, advanced linear algebra
    229 - πŸ“Š Future: Machine learning helpers, symbolic algebra, optimization
    230 
    231 ---
    232 
    233 ## πŸ“œ License
    234 
    235 This project is licensed under the MIT License - see the `LICENSE` file for details.
    236 
    237 ---
    238 
    239 ## πŸ“¬ Contact
    240 
    241 [![Author](https://img.shields.io/badge/Author-Amit%20Dutta-blue)](https://github.com/notamitgamer)  
    242 [![Email](https://img.shields.io/badge/Email-amitdutta4255%40gmail.com-red)](mailto:amitdutta4255@gmail.com)  
    243 [![GitHub](https://img.shields.io/badge/GitHub-notamitgamer-black)](https://github.com/notamitgamer)  
    244 [![PyPI](https://img.shields.io/badge/PyPI-adpkg-green)](https://pypi.org/project/adpkg/)  
    245 [![LinkedIn](https://img.shields.io/badge/LinkedIn-notamitgamer-0A66C2)](https://linkedin.com/in/notamitgamer)  
    246 [![Twitter](https://img.shields.io/badge/Twitter-@notamitgamer-1DA1F2)](https://twitter.com/notamitgamer)  
    247 [![Instagram](https://img.shields.io/badge/Instagram-notamitgamer-E4405F)](https://instagram.com/notamitgamer)
    248 
    249 
    250 
Β© notamitgamer β€’ Site Built: 2026-07-21 13:58:23 UTC β€’ git-mirror commit: 1037f62 [view raw info]
Originally created with stagit β€’ modified by notamitgamer
Forked from github.com/notamitgamer/git-mirror