Skip to main content

MathX

A dependency-free maths toolkit for Python 3.8+.

Status: early development (0.1.0).

Installation

pip install mathx

Quick start

import mathx

mathx.trapezoid_area(4, 6, 3)          # 15.0
mathx.sin(30, degrees=True)            # 0.5
mathx.solve_quadratic(1, -3, 2)        # (1.0, 2.0)
mathx.gcd(12, 18, 24)                  # 6
mathx.convert(1, "mi", "km")           # 1.609344
mathx.evaluate("2 + 3 * sqrt(16)")     # 14.0
mathx.formula("trapezoid area")        # '(a + b) * height / 2'

What is inside

Area Examples
Circle circle_area, circle_circumference, sector_area, arc_length, ellipse_area
Plane shapes square_area, rectangle_perimeter, triangle_area_from_sides, trapezoid_area, regular_polygon_area
Solids cube_volume, cuboid_volume, cylinder_volume, cone_volume, sphere_volume, pyramid_volume
Trigonometry sin, cos, tan, asin, acos, atan, atan2, sinh, cosh, tanh
Arithmetic add, divide, power, sqrt, log(x, base), ln, log2, log10
Number theory gcd, lcm, is_prime, prime_factors, factorial, fibonacci, combinations, permutations
Algebra solve_quadratic, solve_linear_system, simplify_fraction
Statistics mean, median, mode, variance, std_dev
Coordinates distance, midpoint, slope, polygon_area, polygon_perimeter
Units convert, list_units
Reference formula, list_formulas, evaluate

Conventions

  • Angles use radians unless you pass degrees=True.
  • Invalid input raises TypeError (wrong type) or ValueError (wrong value) with a clear message.
  • int, float, Fraction and Decimal are accepted. Formulas that only use + - * / keep Fraction and Decimal exact; formulas with pi or roots return float.

Development

pip install -e ".[dev]"
pytest
ruff check .

License

MIT

Metadata

Release files for mathzx 0.1.0

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for mathzx 0.1.0
File Size Uploaded Provenance Actions
mathzx-0.1.0.tar.gz 17.1 kB With provenance Details for mathzx-0.1.0.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for mathzx 0.1.0
File Interpreter ABI Platform Actions
mathzx-0.1.0-py3-none-any.whl Python 3 none any Details for mathzx-0.1.0-py3-none-any.whl

Total release size: 35.9 kB

Release files / mathzx-0.1.0.tar.gz

Download URL mathzx-0.1.0.tar.gz
Size 17.1 kB
Tags Source
SHA-256 checksum
How to use checksums
f360cca25670c720a107235ebe51b7d003354554d53d5010b30c29598abd9f48
BLAKE2b-256 checksum
How to use checksums
7a5f2b90a1a7bf3188c3c2cde30c4ab373de85ed92fe37ccbb298b544bd7fbc4
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Release files / mathzx-0.1.0-py3-none-any.whl

Download URL mathzx-0.1.0-py3-none-any.whl
Size 18.8 kB
Tags Python 3
SHA-256 checksum
How to use checksums
6cdd6ac2622d773ea5e61e72d79d7d932e9631b5bad509635c0202d4374b6d88
BLAKE2b-256 checksum
How to use checksums
77ee7397f4bd9565822cc0d9c0ddc88a6355176dd341e43c6bff808d7959affc
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
Yes
Uploaded via twine/7.0.0 CPython/3.13.16

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

Security for mathzx 0.1.0

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

Full provenance

Both files in this release have been uploaded with provenance metadata.

Select from 2 files

Attestation for mathzx-0.1.0.tar.gz

PyPI Publish Attestation

PyPI verified that this artifact, at this checksum, originated from the publisher listed below.

Signed by GitHub Actions, verified by PyPI on Oct 23, 2026.

Transparency log

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.0 This release

2 release files Full provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page