"A simple multi-processing based MapReduce framework"
Project description
A Multi-processing based single-host MapReduce Framework
This is a simple mapreduce framework.
Sample program
from mapreduce import *
from math import ceil, sqrt
def mapper_2(item):
return (item + 5) * 23 - 1
def reducer_2(accumulated, item):
return accumulated + item
def is_prime(n):
for i in range(2, ceil(sqrt(n))):
if n % i == 0:
return False
return True
if __name__ == "__main__":
N = 150000
print('* map & reduce ')
mr = MapReducer().prefilter(is_prime).mapper(mapper_2).reducer(reducer_2, 0)
result = mr(range(N))
print(' MR Result :', result)
n = sum([(n + 5) * 23 - 1 for n in range(N) if is_prime(n)])
print(' Validation:', n)
History
0.5.1
update examples
optimize export & imports
0.5.0
process speed optimized
0.1.0
First release
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
mapreduce-py-0.5.1.tar.gz
(3.5 kB
view details)
Built Distribution
File details
Details for the file mapreduce-py-0.5.1.tar.gz
.
File metadata
- Download URL: mapreduce-py-0.5.1.tar.gz
- Upload date:
- Size: 3.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | fde20730411f676bae3edd30d4c77f73086e86b6de294d3f6c77a7454a395170 |
|
MD5 | 1c876339f744d6042f4896fadc220576 |
|
BLAKE2b-256 | aeb5df77bb12d1a7ede73d52bf7a3a5091610ced4ac9770c2c2997375dfc1262 |
File details
Details for the file mapreduce_py-0.5.1-py3-none-any.whl
.
File metadata
- Download URL: mapreduce_py-0.5.1-py3-none-any.whl
- Upload date:
- Size: 4.4 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/1.12.1 pkginfo/1.4.2 requests/2.19.1 setuptools/40.6.2 requests-toolbelt/0.8.0 tqdm/4.28.1 CPython/3.7.2
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | a36185ca93bab0374087100f24b43f44339ec9ce1ab8e96a61ffdaee58915d56 |
|
MD5 | 9b662462fcc915716fa6f0e5289ff17a |
|
BLAKE2b-256 | a3fd35036dd7c70197c1a2438c57dff15c893c259dbce59f683db9ddf588f5fb |