Skip to main content

Fast prime generation for Python based on Sieve of Eratosthenes

Project description

Eratosthenes

Fast prime generation for Python based on Sieve of Eratosthenes

Usage

from eratosthenes import sieve, count, segmented_sieve, segmented_count

# This is a Sieve of Eratosthenes with wheel factorization.
primes = sieve(1000)

# This uses the same logic to count primes up the argument.
num_primes = count(1000)

# This segmented sieve only uses up to 128 KB main memory
primes = segmented_sieve(1000)
num_primes = segmented_count(1000)

About

Eratosthenes is written in C++17 and bound for Python with pybind11. This makes it faster than just about any native Python implementation of Sieve of Eratosthenes!

Copyright

Copyright (c) Daniel Strano and the Qrack contributors 2017-2024. All rights reserved.

Eratosthenes is provided under an 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

eratosthenes-4.0.9.tar.gz (8.0 kB view details)

Uploaded Source

Built Distributions

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

Eratosthenes-4.0.9-cp312-cp312-manylinux_2_39_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.12manylinux: glibc 2.39+ x86-64

Eratosthenes-4.0.9-cp310-cp310-manylinux_2_35_x86_64.whl (1.1 MB view details)

Uploaded CPython 3.10manylinux: glibc 2.35+ x86-64

Eratosthenes-4.0.9-cp38-cp38-manylinux_2_31_x86_64.whl (1.0 MB view details)

Uploaded CPython 3.8manylinux: glibc 2.31+ x86-64

File details

Details for the file eratosthenes-4.0.9.tar.gz.

File metadata

  • Download URL: eratosthenes-4.0.9.tar.gz
  • Upload date:
  • Size: 8.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.0.1 CPython/3.12.3

File hashes

Hashes for eratosthenes-4.0.9.tar.gz
Algorithm Hash digest
SHA256 c8dc2b739861c427218f9f026eaed59dc8925b5945459a7f8242efe2bd27b77c
MD5 da9a693071a4da47385d579963407db8
BLAKE2b-256 90875ff7b0f47157100e6995d19b376ee2bfae4f82686702ca117d1dbcf6ed28

See more details on using hashes here.

File details

Details for the file Eratosthenes-4.0.9-cp312-cp312-manylinux_2_39_x86_64.whl.

File metadata

File hashes

Hashes for Eratosthenes-4.0.9-cp312-cp312-manylinux_2_39_x86_64.whl
Algorithm Hash digest
SHA256 212700056a5177f5e678dad968d7cd8a96c4db4d5ed6c7505f56447165975d4b
MD5 9dd958778e9d1b1defacda003500df3b
BLAKE2b-256 f9730e310057554190d92035b6bce15dd8e7ad6f4fa5722f25085e1af33a3ce7

See more details on using hashes here.

File details

Details for the file Eratosthenes-4.0.9-cp310-cp310-manylinux_2_35_x86_64.whl.

File metadata

File hashes

Hashes for Eratosthenes-4.0.9-cp310-cp310-manylinux_2_35_x86_64.whl
Algorithm Hash digest
SHA256 069eac35e593038d1409bfcef032c68f5cc56d96e50cad1b98faad75416b57c6
MD5 c46d30e0f92f8712c161699933a9df7e
BLAKE2b-256 94b1475fd605f02a449bafc5ade7b1ba436cdc4543da3652c2e5bb3027b5257e

See more details on using hashes here.

File details

Details for the file Eratosthenes-4.0.9-cp38-cp38-manylinux_2_31_x86_64.whl.

File metadata

File hashes

Hashes for Eratosthenes-4.0.9-cp38-cp38-manylinux_2_31_x86_64.whl
Algorithm Hash digest
SHA256 8b9192621d840e39a2364c5b1fbc785574d1f6ca3782947ec355aeeb016cb1fe
MD5 ed073bd18deac71cd33bd6ea2c744c9d
BLAKE2b-256 e0800e7cabc54e178bdbd7106c1022578f0c43dc2b10e4ee655066bcf2b0cd89

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