Skip to main content

A Python extension module for finding primes using C

Project description

PandaPrimes

PandaPrimes is a CPython extension under active development, leveraging the powerful primesieve library to significantly enhance prime number generation performance.

Usage

Iterating Over Primes

Iterating through primes is a common practice, providing a memory-efficient way to work with prime numbers. PandaPrimes introduces two main functionalities for iterating through primes.

primes_range

The primes_range function enables seamless iteration through prime numbers within a specified range.

from PandaPrimes import primes_range

primes_count = 0

# Example 1: Iterate through primes less than or equal to one million
for prime in primes_range(10**6):
    primes_count += 1
primes_count = 0

# Example 2: Iterate through primes in the range between one million and five million
for prime in primes_range(10**6, 5*10**6):
    primes_count += 1

Prime Generation

generate_primes

The generate_primes function creates a NumPy array containing prime numbers within a specified range.

from PandaPrimes import generate_primes

# Example: Generate an array of primes from 2 to 1e10
primes_array = generate_primes(10**10)

generate_n_primes

The generate_n_primes function generates a NumPy array of the first n prime numbers.

from PandaPrimes import generate_n_primes

# Example: Generate an array containing the first million prime numbers
primes_array = generate_n_primes(10**6)

Installation

As of now, PandaPrimes is still under development.

  • for now you can try it by installing primesieve library on you machine first. install primesieve

  • after that you can simply install PandaPrimes using pip.

pip install PandaPrimes

Contributing

We welcome contributions from the community! Feel free to contribute by opening issues, submitting pull requests, or providing feedback.

Please note that the README usage section is a work in progress, and further details will be added as development progresses.

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

PandaPrimes-0.0.6.tar.gz (6.7 kB view details)

Uploaded Source

Built Distributions

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

PandaPrimes-0.0.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (139.5 kB view details)

Uploaded CPython 3.12manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

PandaPrimes-0.0.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (138.8 kB view details)

Uploaded CPython 3.11manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

PandaPrimes-0.0.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (138.0 kB view details)

Uploaded CPython 3.10manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

PandaPrimes-0.0.6-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (137.7 kB view details)

Uploaded CPython 3.9manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

PandaPrimes-0.0.6-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (138.2 kB view details)

Uploaded CPython 3.8manylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

PandaPrimes-0.0.6-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (138.4 kB view details)

Uploaded CPython 3.7mmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

PandaPrimes-0.0.6-cp36-cp36m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl (137.5 kB view details)

Uploaded CPython 3.6mmanylinux: glibc 2.27+ x86-64manylinux: glibc 2.28+ x86-64

File details

Details for the file PandaPrimes-0.0.6.tar.gz.

File metadata

  • Download URL: PandaPrimes-0.0.6.tar.gz
  • Upload date:
  • Size: 6.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.6

File hashes

Hashes for PandaPrimes-0.0.6.tar.gz
Algorithm Hash digest
SHA256 dbeaa84e47fd28b73485ae2750261ed6a669a9e8d2a05025bd119743998ea6f0
MD5 8dcc46dc42ddb3aa2a0478a439264406
BLAKE2b-256 c4777cd8091f628d321d98911c8a85074a0b9d4d041acab2be1b070ac49eceb7

See more details on using hashes here.

File details

Details for the file PandaPrimes-0.0.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PandaPrimes-0.0.6-cp312-cp312-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 ab6145c85afe4ace2a444cba3f349c5fbff5026bd4f87149bee440c577efb309
MD5 f458f17d04e2f04d293888b1e074339b
BLAKE2b-256 d50fe6e5f2f47927005bc2da01bfac8a6934c2816335fa6f4a67f8cfaf8f3a26

See more details on using hashes here.

File details

Details for the file PandaPrimes-0.0.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PandaPrimes-0.0.6-cp311-cp311-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 37115fafb36cec63ee91f3e5ab7791090d8830742f28977b9d977f32b8b22814
MD5 b20c32fed2794f4bcb6f9e9dda1fcaf1
BLAKE2b-256 8fbc6a81f0e8c6cb0ecf5fc6579801e36f2b2d679d37a60f3ac4b61cac3989e7

See more details on using hashes here.

File details

Details for the file PandaPrimes-0.0.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PandaPrimes-0.0.6-cp310-cp310-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 fdd55d1190bee217c24c9d64f9695ae97938e269fd6be07ad975ffda087116f8
MD5 cf691677e5a71c43e729078f55d9b10f
BLAKE2b-256 817feb61ebbb292aa6b0b9b7053baa2b1ca743877550f7ade728ab425b73513c

See more details on using hashes here.

File details

Details for the file PandaPrimes-0.0.6-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PandaPrimes-0.0.6-cp39-cp39-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 2be5c790e832524c48c48c9896ab811a5e80b38d238d07977631a466fb0c8bc3
MD5 600308279ce4b31a1b1bf5624c2c9ad3
BLAKE2b-256 0029175df1fcd4206561618049fa02a8b2d1cc1f6fb7e6bae566328b1ea896fc

See more details on using hashes here.

File details

Details for the file PandaPrimes-0.0.6-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PandaPrimes-0.0.6-cp38-cp38-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 72571d9f19abcf1ff204319a71532b1cf55e231a9b38ed7dec209a0c7fd58ee0
MD5 0dba501c5f98bafdc5aa066a15ede553
BLAKE2b-256 aa1126d92f1c26f05dcc009590a0820df5616ffbb61d7ec62418b234ccb88d6c

See more details on using hashes here.

File details

Details for the file PandaPrimes-0.0.6-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PandaPrimes-0.0.6-cp37-cp37m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 991ea0a361789a0a7411b964694a7cb9f0c22ea86a835766c60bbe897c5c980e
MD5 6e54f0aafa8cbe01c22cb08694633fa6
BLAKE2b-256 8b775d975e70604b9c9aeef7dd50cfd376ecf87dce54d8928044a56d3038b770

See more details on using hashes here.

File details

Details for the file PandaPrimes-0.0.6-cp36-cp36m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl.

File metadata

File hashes

Hashes for PandaPrimes-0.0.6-cp36-cp36m-manylinux_2_27_x86_64.manylinux_2_28_x86_64.whl
Algorithm Hash digest
SHA256 0b3136c8a56a5afdb7cead4e1a5cc07f12a12838d1008f40750fcbaffd936eb6
MD5 0bfabf2e4a1bf9ed7c84268b9f12e5ed
BLAKE2b-256 80751be29b9ed4ba41b437bd85e8dc64caa08f5e3522f7ccffdf2180251d89e4

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