skillfed

primePy

This module contains several useful functions to work with prime numbers. from primePy import primes

primepy v1.3 2.1M downloads/30d#3,261 on PyPI3
Permissive license Abandoned released

What it is and what it does

primePy is a pure-Python module for prime number operations: testing primality, extracting prime factors with multiplicity, generating sequences of primes, and computing Euler's totient function. It exposes a simple API through the `primes` module with methods like `check()`, `factor()`, `factors()`, `first()`, `upto()`, `between()`, and `phi()`. The package has no external runtime dependencies and installs as a single wheel.

The module was designed for reasonable performance on moderate-sized integers (demonstrated on numbers up to around 10^14 and factorizations completing within seconds). However, the package has been abandoned since its single release on 2018-05-29, with no maintenance, bug fixes, or compatibility updates for modern Python environments. It remains functional for basic number-theoretic tasks but carries the risk of incompatibility with future Python versions and no recourse for issues.

Use it for:

  • Educational projects or scripts that need basic primality testing and factorization without external dependencies
  • Cryptographic prototyping or number-theory experiments where you need quick prime generation and Euler's totient
  • Competitive programming or mathematical problem-solving requiring fast prime enumeration up to moderate bounds
  • Legacy systems or offline environments where a self-contained, dependency-free prime utility is preferred

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides functions to test primality, factor integers, generate prime sequences, and compute Euler's totient function for mathematical and cryptographic applications.

Yes, with strong conditions. Install only if you need a lightweight, dependency-free prime utility for educational or experimental use and can tolerate the lack of maintenance. The MIT license and low install friction are advantages, and no known vulnerabilities exist. However, do not use in production or long-term projects—the package is abandoned, and there is no guarantee of compatibility with current or future Python versions. For active development, consider a maintained alternative.

Install

primepy on PyPI

pip

pip install primepy

uv

uv add primepy

poetry

poetry add primepy

Installing primePy

Before you install

Low install friction with no runtime dependencies. However, the package is abandoned—last release and commit were in 2018, with no maintenance activity for years. Use only if you need a stable, self-contained prime utility and can accept no future updates or bug fixes.

License in practice

Licensed under MIT (permissive), so you can use, modify, and distribute freely with minimal restrictions. No licensing barrier to adoption.

Quickstart

pip install primePy
from primePy import primes

# Check if a number is prime
print(primes.check(79012338765433))

# Get all prime factors with multiplicity
print(primes.factors(252))

# Get first n primes
print(primes.first(7))

# Get all primes up to n
print(primes.upto(16))

# Get primes between m and n
print(primes.between(100, 200))

# Compute Euler's totient
print(primes.phi(128))

Verify before relying

  • Whether the package handles edge cases (negative numbers, zero, one) as documented
  • Performance characteristics on modern hardware and Python versions beyond the 2018 test environment
  • Compatibility with Python versions released after 2018 despite 'Programming Language :: Python :: 3' classifier

Package facts

License not declared (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies none
Maintenance abandoned — 2,999 days since the last release
Last repo commit
First released
Downloads 2,138,753/month — #3,261 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: primePy-1.3-py3-none-any.whl

Keywords: fast, prime, facorization, Eular phi, prime check

License :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

prime number checkerinteger factorizationgenerate prime sequenceseuler phi functionprime factor decompositionprimality testingnumber theory utilities
number-theoryabandoned-but-stable

More Mathematics packages