PrimePy

1.3 · abandoned · verified Fri Apr 10

PrimePy is a Python library designed to simplify operations related to prime numbers, offering functions for checking primality, generating primes within a range, and finding prime factors. The library's last update was in May 2018, and it is currently unmaintained, making it potentially unsuitable for new projects or critical applications.

Warnings

Install

Imports

Quickstart

Demonstrates basic usage of `primePy` to check if a number is prime, find its prime factors, and get a list of the first 'n' prime numbers.

from primePy import primes

# Check if a number is prime
print(f"Is 17 prime? {primes.check(17)}")
print(f"Is 10 prime? {primes.check(10)}")

# Get prime factors of a number
print(f"Prime factors of 252: {primes.factors(252)}")

# Get the first 'n' prime numbers
print(f"First 5 primes: {primes.first(5)}")

view raw JSON →