matekit 1.0.3__py3-none-any.whl

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
matekit/CLI.py ADDED
@@ -0,0 +1,39 @@
1
+ import sys
2
+ import inspect
3
+ import matekit
4
+
5
+ def main():
6
+ if len(sys.argv) < 2:
7
+ print("Uso: matekit <funcion> [argumentos]")
8
+ return
9
+
10
+ nombre_funcion = sys.argv[1]
11
+
12
+ # Verifica si la función existe
13
+ if not hasattr(matekit, nombre_funcion):
14
+ print(f"La funcion '{nombre_funcion}' no existe.")
15
+ return
16
+
17
+ funcion = getattr(matekit, nombre_funcion)
18
+
19
+ # Verifica que sea función
20
+ if not callable(funcion):
21
+ print(f"'{nombre_funcion}' no es una funcion.")
22
+ return
23
+
24
+ try:
25
+ # Convierte argumentos a float
26
+ args = [float(arg) for arg in sys.argv[2:]]
27
+
28
+ resultado = funcion(*args)
29
+
30
+ print(resultado)
31
+
32
+ except TypeError:
33
+ print("Cantidad de argumentos incorrecta.")
34
+
35
+ except ValueError:
36
+ print("Los argumentos deben ser numeros.")
37
+
38
+ if __name__ == "__main__":
39
+ main()
matekit/__init__.py ADDED
@@ -0,0 +1,11 @@
1
+ from .aritmetica import *
2
+ from .algebra import *
3
+ from .lineal import *
4
+ from .trigonometria import *
5
+ from .calculo import *
6
+ from .geometria import *
7
+ from .estadistica import *
8
+ from .fisica import *
9
+ from .conversiones import *
10
+ from .graficas import *
11
+ from .calculadora import *
matekit/algebra.py ADDED
@@ -0,0 +1,20 @@
1
+ import math
2
+
3
+ def ecuacion_lineal(a, b):
4
+ return -b / a
5
+
6
+ def bhaskara(a, b, c):
7
+ d = b**2 - 4*a*c
8
+
9
+ x1 = (-b + math.sqrt(d)) / (2*a)
10
+ x2 = (-b - math.sqrt(d)) / (2*a)
11
+
12
+ return x1, x2
13
+
14
+ def sistema_2x2(a1, b1, c1, a2, b2, c2):
15
+ det = a1*b2 - a2*b1
16
+
17
+ x = (c1*b2 - c2*b1) / det
18
+ y = (a1*c2 - a2*c1) / det
19
+
20
+ return x, y
matekit/aritmetica.py ADDED
@@ -0,0 +1,39 @@
1
+ def suma(a, b):
2
+ return a + b
3
+
4
+ def resta(a, b):
5
+ return a - b
6
+
7
+ def multiplicar(a, b):
8
+ return a * b
9
+
10
+ def dividir(a, b):
11
+ if b == 0:
12
+ return "No se puede dividir entre 0"
13
+
14
+ return a / b
15
+
16
+ def potencia(a, b):
17
+ return a ** b
18
+
19
+ def raiz(a):
20
+ return a ** 0.5
21
+
22
+ def factorial(n):
23
+ if n == 0:
24
+ return 1
25
+
26
+ return n * factorial(n - 1)
27
+
28
+ def es_par(n):
29
+ return n % 2 == 0
30
+
31
+ def es_primo(n):
32
+ if n < 2:
33
+ return False
34
+
35
+ for i in range(2, int(n ** 0.5) + 1):
36
+ if n % i == 0:
37
+ return False
38
+
39
+ return True
matekit/calculadora.py ADDED
@@ -0,0 +1,26 @@
1
+ import math
2
+
3
+ def calc():
4
+ print("=== Matekit Calculator ===")
5
+ print("Type 'exit' to quit")
6
+
7
+ allowed = {}
8
+
9
+ # Agrega funciones matemáticas
10
+ for name in dir(math):
11
+ if not name.startswith("_"):
12
+ allowed[name] = getattr(math, name)
13
+
14
+ while True:
15
+ expr = input(">>> ")
16
+
17
+ if expr.lower() == "exit":
18
+ print("Goodbye!")
19
+ break
20
+
21
+ try:
22
+ result = eval(expr, {"__builtins__": {}}, allowed)
23
+ print(result)
24
+
25
+ except Exception as e:
26
+ print("Error:", e)
matekit/calculo.py ADDED
@@ -0,0 +1,2 @@
1
+ def derivada_simple(x, h=0.0001):
2
+ return ((x + h) ** 2 - x ** 2) / h
@@ -0,0 +1,11 @@
1
+ def celsius_a_fahrenheit(c):
2
+ return (c * 9/5) + 32
3
+
4
+ def fahrenheit_a_celsius(f):
5
+ return (f - 32) * 5/9
6
+
7
+ def km_a_millas(km):
8
+ return km * 0.621371
9
+
10
+ def millas_a_km(m):
11
+ return m * 1.60934
matekit/estadistica.py ADDED
@@ -0,0 +1,11 @@
1
+ def promedio(lista):
2
+ return sum(lista) / len(lista)
3
+
4
+ def mayor(lista):
5
+ return max(lista)
6
+
7
+ def menor(lista):
8
+ return min(lista)
9
+
10
+ def suma_lista(lista):
11
+ return sum(lista)
matekit/fisica.py ADDED
@@ -0,0 +1,8 @@
1
+ def velocidad(distancia, tiempo):
2
+ return distancia / tiempo
3
+
4
+ def fuerza(masa, aceleracion):
5
+ return masa * aceleracion
6
+
7
+ def energia_cinetica(masa, velocidad):
8
+ return 0.5 * masa * (velocidad ** 2)
matekit/geometria.py ADDED
@@ -0,0 +1,16 @@
1
+ PI = 3.1416
2
+
3
+ def area_circulo(r):
4
+ return PI * r * r
5
+
6
+ def perimetro_circulo(r):
7
+ return 2 * PI * r
8
+
9
+ def area_rectangulo(base, altura):
10
+ return base * altura
11
+
12
+ def area_triangulo(base, altura):
13
+ return (base * altura) / 2
14
+
15
+ def volumen_cubo(lado):
16
+ return lado ** 3
matekit/graficas.py ADDED
@@ -0,0 +1,14 @@
1
+ import matplotlib.pyplot as plt
2
+ import numpy as np
3
+
4
+ def graficar_cuadratica():
5
+ x = np.linspace(-10, 10, 400)
6
+ y = x**2
7
+
8
+ plt.plot(x, y)
9
+ plt.title("Grafica de y = x^2")
10
+ plt.xlabel("X")
11
+ plt.ylabel("Y")
12
+ plt.grid(True)
13
+
14
+ plt.show()
matekit/lineal.py ADDED
@@ -0,0 +1,8 @@
1
+ def suma_vectores(v1, v2):
2
+ return [a + b for a, b in zip(v1, v2)]
3
+
4
+ def resta_vectores(v1, v2):
5
+ return [a - b for a, b in zip(v1, v2)]
6
+
7
+ def producto_escalar(v1, v2):
8
+ return sum(a * b for a, b in zip(v1, v2))
@@ -0,0 +1,16 @@
1
+ import math
2
+
3
+ def seno(x):
4
+ return math.sin(x)
5
+
6
+ def coseno(x):
7
+ return math.cos(x)
8
+
9
+ def tangente(x):
10
+ return math.tan(x)
11
+
12
+ def grados_a_radianes(g):
13
+ return math.radians(g)
14
+
15
+ def radianes_a_grados(r):
16
+ return math.degrees(r)
@@ -0,0 +1,5 @@
1
+ Metadata-Version: 2.4
2
+ Name: matekit
3
+ Version: 1.0.3
4
+ Summary: Matekit is a modern Python mathematics library designed to make calculations, graphing, algebra, geometry, statistics, and mathematical utilities simple and powerful. It provides an easy-to-use API for students, developers, and anyone working with mathematics in Python.
5
+ Author: Nico
@@ -0,0 +1,18 @@
1
+ matekit/CLI.py,sha256=2o59YJc8OF5Td6XQaLMoA6G37XUK_V3TItq4MEByAEM,910
2
+ matekit/__init__.py,sha256=Z-4eFfYwMTt5CtmWOGLhWfR2Rwx2K4mQpT6Us-jtUGg,285
3
+ matekit/algebra.py,sha256=QKicXB1ArTWuvPl3TaeQefIkCWuEsFdaUXh5rYIj3GA,359
4
+ matekit/aritmetica.py,sha256=rEF1XVwJQ-gsL8UuSs9iFtToTEpdK6guhac0q5tAxBQ,600
5
+ matekit/calculadora.py,sha256=PRGmZ-pVOoa8_hN7oCAxGxgsTrFuAPWqdANDR29fkf4,585
6
+ matekit/calculo.py,sha256=9gg6ceobKClnvXtUkShdSdYd-KwW1qJKWwkmwZIxjpM,73
7
+ matekit/conversiones.py,sha256=PPmA_B5ivMMGi0Xqoi5oHG931quYGP080dk4X860a_0,211
8
+ matekit/estadistica.py,sha256=hACEEXAkixffMQC7QJ9DNj90hx4NqIl9GdStRQuqMlI,193
9
+ matekit/fisica.py,sha256=MgBjXp9DUh7MhrlPydSj6vyk5AICBP7tGw2hhKZYJ1Y,213
10
+ matekit/geometria.py,sha256=fIBeoP_ooO0oSRZmv85eFy165OgFRYGHPbd2XCfvdTM,292
11
+ matekit/graficas.py,sha256=Z9Q_8NoRusM8MoRNYTcYvIVb_iSvYIZybwslfGIUv9k,269
12
+ matekit/lineal.py,sha256=ciJCR2RiWcSZJ8-BHu1GiFQA5DkpPcI4awhwWDWioSw,225
13
+ matekit/trigonometria.py,sha256=TUQMVYVbrOnOgV6KVXGXUaknQaUSL6I15CvkqHyhapw,251
14
+ matekit-1.0.3.dist-info/METADATA,sha256=H23mRIV2zjUSGD5eTk8Ba7WDnXiADpoM-NvRbTWjdnc,349
15
+ matekit-1.0.3.dist-info/WHEEL,sha256=aeYiig01lYGDzBgS8HxWXOg3uV61G9ijOsup-k9o1sk,91
16
+ matekit-1.0.3.dist-info/entry_points.txt,sha256=N26JxEBBwkXegC-9ZQKUJVp42NwrH-wZDwEMbBXM88I,45
17
+ matekit-1.0.3.dist-info/top_level.txt,sha256=XqprctrXrexezMhaqUjLshYJslRtRtawbPsiNcBbK5Q,8
18
+ matekit-1.0.3.dist-info/RECORD,,
@@ -0,0 +1,5 @@
1
+ Wheel-Version: 1.0
2
+ Generator: setuptools (82.0.1)
3
+ Root-Is-Purelib: true
4
+ Tag: py3-none-any
5
+
@@ -0,0 +1,2 @@
1
+ [console_scripts]
2
+ matekit = matekit.cli:main
@@ -0,0 +1 @@
1
+ matekit