
Security News
Deno 2.6 + Socket: Supply Chain Defense In Your CLI
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.
tinymr
Advanced tools
Experimental Pythonic MapReduce inspired by Spotify's luigi framework <http://www.github.com/Spotify/luigi>_.
.. image:: https://travis-ci.org/geowurster/tinymr.svg?branch=master :target: https://travis-ci.org/geowurster/tinymr?branch=master
.. image:: https://coveralls.io/repos/geowurster/tinymr/badge.svg?branch=master :target: https://coveralls.io/r/geowurster/tinymr?branch=master
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().
.. code-block:: python
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:
.. code-block:: json
{
"a": 1,
"above": 2,
"advised": 1,
"all": 1,
"and": 8,
"andor": 1
}
.. code-block:: console
$ git clone https://github.com/geowurster/tinymr.git
$ cd tinymr
$ pip install -e .\[dev\]
$ py.test tests --cov tinymr --cov-report term-missing
See LICENSE.txt
See CHANGES.md
FAQs
Pythonic in-memory MapReduce.
We found that tinymr demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Deno 2.6 introduces deno audit with a new --socket flag that plugs directly into Socket to bring supply chain security checks into the Deno CLI.

Security News
New DoS and source code exposure bugs in React Server Components and Next.js: what’s affected and how to update safely.

Security News
Socket CEO Feross Aboukhadijeh joins Software Engineering Daily to discuss modern software supply chain attacks and rising AI-driven security risks.