Skip to main content
Join the official 2019 Python Developers SurveyStart the survey!

"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)



  • update examples
  • optimize export & imports


  • process speed optimized


  • First release

Project details

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Files for mapreduce-py, version 0.5.1
Filename, size File type Python version Upload date Hashes
Filename, size mapreduce_py-0.5.1-py3-none-any.whl (4.4 kB) File type Wheel Python version py3 Upload date Hashes View hashes
Filename, size mapreduce-py-0.5.1.tar.gz (3.5 kB) File type Source Python version None Upload date Hashes View hashes

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging AWS AWS Cloud computing DataDog DataDog Monitoring Fastly Fastly CDN SignalFx SignalFx Supporter DigiCert DigiCert EV certificate StatusPage StatusPage Status page