This is a pre-production deployment of Warehouse, however changes made here WILL affect the production instance of PyPI.
Latest Version Dependencies status unknown Test status unknown Test coverage unknown
Project Description

Experimental Pythonic MapReduce inspired by Spotify’s luigi framework.

Canonical Word Count Example

Currently there are two MapReduce implementations, one that includes sorting and one that does not. The example below would not benefit from sorting so we can take advantage of the inherent optimization of not sorting. The API is the same but tinymr.memory.MRSerial() sorts after partitioning and again between the reducer() and final_reducer().

import json
import re
import sys

from tinymr.memory import MRSerial

class WordCount(MRSerial):

    def __init__(self):
        self.pattern = re.compile('[\W_]+')

    def mapper(self, item):
        for word in item.split():
            word = self.pattern.sub('', word)
            if word:
                yield word.lower(), 1

    def reducer(self, key, values):
        yield key, sum(values)

    def final_reducer(self, pairs):
        return {k: tuple(v)[0] for k, v in pairs}

wc = WordCount()
with open('LICENSE.txt') as f:
    out = wc(f)
    print(json.dumps(out, indent=4, sort_keys=True))

Truncated output:

    "a": 1,
    "above": 2,
    "advised": 1,
    "all": 1,
    "and": 8,
    "andor": 1


$ git clone
$ cd tinymr
$ pip install -e .\[dev\]
$ py.test tests --cov tinymr --cov-report term-missing





Release History

Release History


This version

History Node

TODO: Figure out how to actually get changelog content.

Changelog content for this version goes here.

Donec et mollis dolor. Praesent et diam eget libero egestas mattis sit amet vitae augue. Nam tincidunt congue enim, ut porta lorem lacinia consectetur. Donec ut libero sed arcu vehicula ultricies a non tortor. Lorem ipsum dolor sit amet, consectetur adipiscing elit.

Show More

Download Files

Download Files

TODO: Brief introduction on what you do with files - including link to relevant help section.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
tinymr-0.1-py2.py3-none-any.whl (15.1 kB) Copy SHA256 Checksum SHA256 py2.py3 Wheel Sep 18, 2016
tinymr-0.1.tar.gz (16.8 kB) Copy SHA256 Checksum SHA256 Source Sep 18, 2016

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS HPE HPE Development Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting