No project description provided
Project description
eapy
A Python utility library that extends the standard library with math, algebra, data structures, and everyday tools.
Features
Math & Algebra
- Vector —
Vector2D,Vector3D, and N-dimensionalVectorwith arithmetic, dot product, magnitude, coordinate conversions - Matrix — 2D matrix operations (add, subtract, multiply, divide, power) with N×N determinant
- Tensor — 3D tensor with arithmetic, slicing, transpose
- Polynomial — polynomial arithmetic, evaluation (Horner's method), derivative, integral
- Complex — complex number arithmetic, conjugate, phase, polar conversion
- Symbolic Algebra —
Varfor building symbolic expressions with simplify & evaluate - InfiniteSet / Interval — set operations on numeric intervals
Trigonometry
- Full set:
sin,cos,tan,sec,csc,cot - Inverse:
asin,acos,atan,atan2,asec,acsc,acot - Hyperbolic:
sinh,cosh,tanh,asinh,acosh,atanh - Versed:
versine,vercosine,coversine,covercosine
Combinatorics & Number Theory
permutation,combination,catalan,stirling2gcd,lcm,isPrime,fibonacci,digitsSumeulerTotient,primeFactors,modPow
Statistics
mean,median,variance,std,mode
String Utilities
- Name conversion:
toCamelCase,toSnakeCase,toPascalCase levenshtein— edit distance between two strings
Functional Programming
pipe(value, f, g, h)— pipeline:h(g(f(value)))compose(f, g, h)(x)— composition:f(g(h(x)))curry(func)(a)(b)(c)— currying
Data Structures
Stack— LIFO stack (push/pop/peek)Queue— FIFO queue (enqueue/dequeue)Trie— prefix tree (insert/search/words_with_prefix)
Base Conversion
baseConvert(n, from_base, to_base)— arbitrary base conversion (2-36)toBinary,toOctal,toHex— quick conversions
Color Utilities
rgbToHsl/hslToRgb— RGB ↔ HSL conversionrgbToHex/hexToRgb— RGB ↔ HEX conversion
Numerical Methods
bisect(f, a, b)— bisection root findingnewtonMethod(f, f', x0)— Newton's methodnumericalIntegral(f, a, b)— Simpson's rule integration
Utility & Decorators
Timer— simple stopwatch timerclamp,lerp,mapRange— numeric helpersflatten,chunk,deepGet,uniqueId— data helpers@retry,@memoize,@deprecated,@singleton— decoratorsprintTable— formatted console table outputgetPath— interactive file/directory pickerrepeatUntilSecond,repeatUntilSecondOrBool,repeatUntilValueChange— loop helpers
Broadcast / Messaging
whenGetMessage,broadcast,broadcastWithData— simple event system
Installation
pip install -i https://test.pypi.org/simple/ eapyTool
Quick Start
from eapy.core import Var, Polynomial, Vector3D, mean
# Symbolic algebra
x = Var('x')
expr = (x + 2) * (x + 3)
print(expr.evaluate(x=5)) # 56.0
# Polynomial
p = Polynomial([1, -3, 2]) # 1 - 3x + 2x^2
print(p.derivative()) # -3 + 4*x
print(p(10)) # 171.0
# Vector
v = Vector3D(1, 2, 3)
print(v.abs()) # 3.7416...
# Statistics
print(mean([4, 8, 15, 16, 23, 42])) # 18.0
Development
# install with dev dependencies
pip install -e ".[dev]"
# run tests
pytest
# lint
ruff check src tests
ruff format --check src tests
License
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
eapytool-0.1.1.tar.gz
(19.9 kB
view details)
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
eapytool-0.1.1-py3-none-any.whl
(19.8 kB
view details)
File details
Details for the file eapytool-0.1.1.tar.gz.
File metadata
- Download URL: eapytool-0.1.1.tar.gz
- Upload date:
- Size: 19.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
ccf338f24f825f7fccf0afb9bb3d9739435de16be45a3a3cab080e35910be87b
|
|
| MD5 |
29e5ba865b692b134b4229633b4e32c2
|
|
| BLAKE2b-256 |
935770d90afe47f94efbd20dca990f2ad1c246ca59adc16ab5bb4abe21f441cf
|
File details
Details for the file eapytool-0.1.1-py3-none-any.whl.
File metadata
- Download URL: eapytool-0.1.1-py3-none-any.whl
- Upload date:
- Size: 19.8 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.2.0 CPython/3.11.8
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
4d262ff825e5431a8d346f7e40d7299649ebcea7ac6efb2106026fb6b7de4865
|
|
| MD5 |
4a5c8bf9c6dfca0ca5613f52cc9c577c
|
|
| BLAKE2b-256 |
630d11a8e08c3562a796f4ba889eacca9466329f9233311cb6c51dbb6415203e
|