Registry / data / mathruler

mathruler

JSON →
library0.1.0pypypi✓ verified 83d ago

MathRuler is a powerful and versatile Python library, currently at version 0.1.0, designed to simplify and enhance mathematical calculations. It aims to provide tools for handling equations, units, and general computations, leveraging symbolic and numerical backends. As an early-stage library, its API is subject to iterative improvements with a rapid release cadence.

pip install mathruler
INSTALL
IMPORT
SIG · MATHRULER
M
mathruler
datapythonv0.1.0
Install
1.6s avg
Import
Disk
16MB
Pass rate
10/ 10
Env Coverage10 / 10
glibc
3.93.13
musl
3.93.13
Install & Compatibility
Where this runs
tested against v0.1.0 · pip install
no network on importno background threads
Install × environment matrix
Each cell = how many times install + import succeeded across repeated harness runs. Partial = flaky.
glibc = Debian/Ubuntu slim · musl = Alpine Linux
musl
py 3.103.910 runs
installs and imports cleanly · install 0.0s · import 0.000s · 17.9MB
glibc
py 3.103.910 runs
installs and imports cleanly · install 1.6s · import 0.000s · 18MB
16MB installed
● package 16MB
Code
Verified usage

Verified import paths — ran on the pinned version, not inferred.

MathRuler
import mathruler
from mathruler import MathRuler

Initializes a MathRuler instance and demonstrates solving a simple equation, evaluating an expression, and using variables. The `.equation()` method returns an equation object that can be further manipulated, for example, to solve for a specific variable. The `.evaluate()` method directly computes an expression.

from mathruler import MathRuler # Initialize the MathRuler ruler = MathRuler() # Solve a simple algebraic equation result_equation = ruler.equation("2x + 5 = 10") print(f"Equation result: {result_equation.solve_for('x')}") # Perform a calculation with units (if supported in future versions, currently basic) # Note: Unit support is an evolving feature and may require specific syntax. # For 0.1.0, focus on basic equations. # Example: Evaluate an expression result_eval = ruler.evaluate("5 * (3 + 2)") print(f"Evaluation result: {result_eval}") # Define and use a variable ruler.set_variable('y', 15) result_var = ruler.evaluate("y / 3") print(f"Variable calculation result: {result_var}")
Debug
Known issues
breakingAs a 0.x.x version, the API of MathRuler is not yet stable and is subject to significant changes, including method signatures, class names, and module structure, without adhering to strict semantic versioning.
fix
Always consult the latest GitHub README and documentation for current API usage. Pin specific minor versions if stability is critical for your project, but be prepared for potential refactoring when upgrading.
affects: 0.1.0 - current
gotchaWhile MathRuler aims to handle equations, parsing complex or ambiguous mathematical expressions can be challenging. Input strings must often adhere to a specific syntax or standard for correct interpretation.
fix
When encountering unexpected results, simplify your expressions or break them into smaller, more explicit parts. Refer to the documentation (or source code for 0.1.0) for supported syntax and operations. Avoid shorthand or implicit operations that might not be universally parsed.
affects: 0.1.0 - current
gotchaMathematical calculations, especially with floating-point numbers, can introduce precision errors. MathRuler relies on underlying libraries like SymPy and NumPy, which also handle floats with standard IEEE 754 precision.
fix
For applications requiring high precision, consider using MathRuler's symbolic capabilities where applicable, or explicitly implement decimal arithmetic. Be aware that comparisons of floating-point results should often involve a tolerance (epsilon) rather than direct equality checks.
affects: 0.1.0 - current
Upgrade
Version history
0.1.0latest on PyPI · released Feb 22, 2025
Audit
Dependencies
sympyrequiredRequired for symbolic computation and equation parsing.
numpyrequiredRequired for numerical operations and array handling.
Agent activity
9 hits · last 30 days
node
8
Resources
mathruler — pip install mathruler · libregistry