The ultimate unified mathematics module - 3600+ functions from math, numpy, scipy, sympy and more
Project description
UniversalMath ๐งฎ
The Ultimate Unified Python Mathematics Module
Version 0.1.1 - Complete coverage with lazy loading
๐ฏ What is UniversalMath?
UniversalMath is a comprehensive, unified mathematics module that combines ALL functions from Python's mathematical ecosystem into a single, easy-to-use package. It features:
- โ 3,600+ mathematical functions from one import
- โ 100% coverage of math, cmath, statistics, decimal, fractions, numpy, scipy, sympy, pandas
- โ 75+ custom utility functions for everyday math
- โ Lazy loading - modules imported only when needed
- โ Legacy support - works even if some modules aren't installed
- โ Zero configuration - just import and use
๐ Quick Start
import universalmath as um
# Standard math - works immediately
um.sqrt(16) # 4.0
um.sin(um.pi/2) # 1.0
um.factorial(5) # 120
# Statistics
um.mean([1, 2, 3, 4, 5]) # 3.0
um.stdev([1, 2, 3]) # 1.0
# Custom utilities
um.is_prime(17) # True
um.fibonacci(10) # [0, 1, 1, 2, 3, 5, 8, 13, 21, 34]
um.lerp(0, 100, 0.5) # 50.0
# NumPy (auto-loaded when first used)
um.np_array([1, 2, 3]) # array([1, 2, 3])
um.matrix([[1,2],[3,4]]) # 2x2 matrix
# SciPy (auto-loaded when first used)
um.sp_stats_norm.pdf(0) # 0.3989422804014327
um.sp_optimize_minimize(...) # Optimization
# Symbolic math (auto-loaded when first used)
x = um.sym_Symbol('x')
um.sym_diff(x**2, x) # 2*x
๐ฆ Installation
# Basic installation (standard library only)
pip install -e .
# Full installation (with all optional packages)
pip install -e ".[full]"
# Install specific extras
pip install -e ".[numpy]" # Just NumPy
pip install -e ".[scipy]" # NumPy + SciPy
pip install -e ".[symbolic]" # SymPy for symbolic math
โก Key Features
1. Lazy Loading
Modules are imported only when you use them, saving memory and import time:
import universalmath as um # Instant, no heavy imports
um.sqrt(16) # Uses built-in math (already loaded)
um.np_array([1,2,3]) # NOW numpy gets imported
um.sym_Symbol('x') # NOW sympy gets imported
2. 100% Coverage
Every single function from each module is available:
Core Modules (188 functions):
- โ math (52 functions) - Real number mathematics
- โ cmath (30 functions) - Complex number mathematics
- โ statistics (37 functions) - Statistical analysis
- โ decimal (3 items) - High-precision arithmetic (Decimal class + rounding modes)
- โ fractions (1 items) - Rational number arithmetic (Fraction class)
- โ random (32 functions) - Random number generation (includes classes and constants)
- โ builtins (5 functions) - Python built-ins (abs, round, min, max, sum, pow, len, sorted, reversed)
NumPy (581 functions):
- โ numpy (466 functions) - Array operations & numerical computing
- โ numpy.linalg (33 functions) - Linear algebra
- โ numpy.random (63 functions) - Random number generation
- โ numpy.fft (19 functions) - Fast Fourier transforms
SciPy (1,179 functions):
- โ scipy.stats (302 functions) - Statistical distributions & tests
- โ scipy.linalg (100 functions) - Advanced linear algebra
- โ scipy.optimize (72 functions) - Optimization & root finding
- โ scipy.integrate (34 functions) - Numerical integration & ODEs
- โ scipy.interpolate (58 functions) - Data interpolation
- โ scipy.signal (158 functions) - Signal processing
- โ scipy.fft (42 functions) - FFT operations
- โ scipy.special (363 functions) - Special mathematical functions
- โ scipy.sparse (50 functions) - Sparse matrix operations
Symbolic & Data (977 functions):
- โ sympy (875 functions) - Symbolic mathematics & computer algebra
- โ pandas (102 functions) - Data analysis & manipulation
PyPyNum (415 functions):
- โ pypynum (413 functions) โ Pure Python scientific computing
- โ pypynum.arrays (21 functions) โ Array utilities
- โ pypynum.equations (2 functions) โ Equation solvers
- โ pypynum.graphs (6 functions) โ Graph-related utilities
- โ pypynum.maths (88 functions) โ Core mathematical functions
- โ pypynum.matrices (21 functions) โ Matrix operations
- โ pypynum.multiprec (26 functions) โ Multi-precision arithmetic
- โ pypynum.random (12 functions) โ Random utilities
- โ pypynum.regs (4 functions) โ Regression utilities
- โ pypynum.stattest (6 functions) โ Statistical tests
- โ pypynum.symbols (1 function) โ Symbol definitions
- โ pypynum.tensors (5 functions) โ Tensor operations
- โ pypynum.tools (31 functions) โ Helper and utility tools
- โ pypynum.vectors (3 functions) โ Vector operations
Custom Utilities (78 functions):
- โ universalmath.utils (77 functions) - Number theory, geometry, finance, interpolation, vectors, CLI tools, etc.
- โ universalmath.cli (1 function) - Command-line interface
๐ฏ GRAND TOTAL: 3,614 functions from one import!
3. 75+ Custom Utilities
Practical functions you actually need:
# Number theory
um.is_prime(17) # True
um.primes_up_to(50) # [2, 3, 5, 7, 11, ...]
um.prime_factors(60) # [2, 2, 3, 5]
um.totient(9) # Euler's totient: 6
um.chinese_remainder_theorem([2,3], [5,7]) # CRT solver
# Interpolation
um.lerp(0, 100, 0.5) # 50.0
um.remap(5, 0, 10, 0, 100) # 50.0
um.smoothstep(0, 1, 0.5) # Smooth easing
# Finance
um.compound_interest(1000, 0.05, 10) # $1628.89
um.annuity_payment(10000, 0.05/12, 60) # Monthly payment
# Numerical methods
um.newton_raphson(lambda x: x**2 - 2, lambda x: 2*x, 1) # Find โ2
um.numerical_integral_simpson(lambda x: x**2, 0, 1) # โซxยฒdx
# Geometry
um.circle_area(5) # 78.54
um.sphere_volume(3) # 113.10
um.polygon_area([(0,0), (1,0), (1,1)]) # 0.5
# Vectors
um.dot_product([1,2,3], [4,5,6]) # 32
um.cross_product_3d([1,0,0], [0,1,0]) # (0, 0, 1)
um.angle_between_vectors([1,0], [0,1]) # 1.5708 (ฯ/2)
# Unit conversions
um.celsius_to_fahrenheit(100) # 212.0
um.degrees_to_radians_precise(45, 30, 0) # Degrees/minutes/seconds
4. Legacy Support
Works on any system, even with missing packages:
# On a minimal system without NumPy
import universalmath as um
um.sqrt(16) # โ
Works (uses built-in math)
um.mean([1,2,3]) # โ
Works (uses built-in statistics)
um.np_array([1,2]) # โ Raises helpful error: "NumPy not installed"
5. Smart Naming
Clear prefixes prevent conflicts:
| Module | Prefix | Example |
|---|---|---|
| math | none | sqrt, sin |
| cmath | c |
csqrt, csin |
| numpy | np_ |
np_array, np_mean |
| scipy.stats | sp_stats_ |
sp_stats_norm |
| scipy.optimize | sp_optimize_ |
sp_optimize_minimize |
| sympy | sym_ |
sym_diff, sym_integrate |
| pandas | pd_ |
pd_DataFrame |
๐ Comparison
| Feature | UniversalMath | Standard Approach |
|---|---|---|
| Import complexity | import universalmath as um |
Multiple imports |
| Functions available | 3,600+ | Need to remember which module |
| Memory usage | Lazy loaded | All upfront |
| Coverage | 100% of all modules | Manual selection |
| Utilities | 75+ included | Write your own |
| Legacy support | โ Graceful degradation | โ Crashes if missing |
๐ License
MIT License - See LICENSE file for details
๐ Acknowledgments
UniversalMath builds upon:
- Python Standard Library (math, cmath, statistics, decimal, fractions, random)
- NumPy
- SciPy
- SymPy
- Pandas
- PyPyNum
Made with โค๏ธ for mathematicians, scientists, engineers, and developers who want math to just workโข
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 universalmath-0.1.1.tar.gz.
File metadata
- Download URL: universalmath-0.1.1.tar.gz
- Upload date:
- Size: 28.7 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
e4df74584488b4b9f3169e8478cafc37b310f2d1549629ad6384569a27f4bcac
|
|
| MD5 |
ce298efc340e41aac509f993a59442f6
|
|
| BLAKE2b-256 |
6fdc835c96ba30b140ced576396098973b590eee9709b60fc097809dcb934a5a
|
File details
Details for the file universalmath-0.1.1-py3-none-any.whl.
File metadata
- Download URL: universalmath-0.1.1-py3-none-any.whl
- Upload date:
- Size: 21.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.12.6
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
548c16e7db82d057781f819f5a76f28baaf5cd51abbd1838de3cc7437e5c1f49
|
|
| MD5 |
4b8c2fb3835fbf7fbc291ec9cf630673
|
|
| BLAKE2b-256 |
125ccd7e1305b8dec93e46d85bdc5d4f981175704c4b093b0495b634f2dd5e75
|