Skip to main content

Pythagix is a lightweight Python library that provides a collection of mathematical utility functions for number theory

Project description

Pythagix

Pythagix is a high-performance, battle-tested Python library for number theory and statistics. It delivers blazing-fast, reliable, and precise implementations of essential mathematical utilities, including prime checking, GCD/LCM, ratio simplification, triangular numbers, and more. Designed for developers, students, and researchers alike, Pythagix makes handling massive numbers, complex computations, and advanced math operations simple, efficient, and hassle-free.

Source code: https://github.com/UltraQuantumScriptor/pythagix

Features

Primes & Factorization: is_prime, nth_prime, prime_factorization, prime_factors

GCD / LCM / Ratios: gcd, lcm, simplify_ratio, is_equivalent

Statistics: mean, median, mode, variance, pvariance, std_dev, pstd_dev

Other utilities: triangle_number, compress_0, product, nCr, get_factors

Each function is fully tested and designed for high performance with arbitrarily large integers.

Installation

pip install pythagix

Usage

from pythagix import gcd, is_prime, nth_prime

# Compute GCD of large numbers
print(gcd([12345678901234567890, 98765432109876543210]))

# Check if a number is prime
print(is_prime(101))  # True

# Get the 1000th prime number
print(nth_prime(1000))

Testing

Pythagix uses pytest for automated testing. To run the test suite:

pytest

All core functionality is verified for correctness and performance across large inputs.

Contributing

Contributions are welcome. To report bugs, suggest improvements, or submit code enhancements:

Open an issue on GitHub

Submit a pull request

Refer to the repository’s CONTRIBUTING.md for detailed guidelines.

License

Pythagix is licensed under the MIT License.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pythagix-0.2.23.tar.gz (11.8 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pythagix-0.2.23-cp313-cp313-win_amd64.whl (37.6 kB view details)

Uploaded CPython 3.13Windows x86-64

File details

Details for the file pythagix-0.2.23.tar.gz.

File metadata

  • Download URL: pythagix-0.2.23.tar.gz
  • Upload date:
  • Size: 11.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pythagix-0.2.23.tar.gz
Algorithm Hash digest
SHA256 22e2b024cdac98d86fea6d1f73b824bc691c3b5fc3cb4a9635e4a124e8e591a2
MD5 23cc94ff962c3a606ac47c6d9f455b6c
BLAKE2b-256 5263d3c224fcfd684725eaf45b84374047db15fc2421d5b4e1648b851f4a85a9

See more details on using hashes here.

File details

Details for the file pythagix-0.2.23-cp313-cp313-win_amd64.whl.

File metadata

  • Download URL: pythagix-0.2.23-cp313-cp313-win_amd64.whl
  • Upload date:
  • Size: 37.6 kB
  • Tags: CPython 3.13, Windows x86-64
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for pythagix-0.2.23-cp313-cp313-win_amd64.whl
Algorithm Hash digest
SHA256 cb2917016de91052c50d3a32d49e0b3e3d81860695aea7eda1a01c20289a9983
MD5 72bc6b910c2fde1374749de58cc2de0e
BLAKE2b-256 41e255a26c143b948775873bc8e6f8f37114c08647bf4e694272afa17e32373d

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page