Skip to main content

Fast, simple message matching

Project description


released 26-July-2017

- Initial Release

Author: Dana M. Diederich
License: MIT
Description: message-match

Fast, simple message matching



from message_match import mmatch

mmatch({'a':'b'},{'a':'b'}) == True
mmatch({'a':'b','c':'d'},{'a':'b'}) == True
mmatch({'a':'b'},{'c':'d'}) == False
mmatch({'a':'b', 'c':'d'},{'a':'b', 'c':'d'}) == True
mmatch({'x':{'y':'z'}},{'x':{'y':'z'}}) == True
mmatch({'a':'b', 'x':{'y':'z'}},{'x':{'y':'z'}}) == True
mmatch({'a':'b', 'x':{'y':'z'}},{'a':'b', 'x':{'y':'z'}}) == True
mmatch({'a': [1,2,3]},{'a':2}) == True #TODO
mmatch({'a': [1,2,3]},{'a':5}) == True #TODO
mmatch({'a': [1,2,3]},{'a': [1,2,3]}) == True #TODO
mmatch({'a': [{'a':'b'},2,3]},{'a': [{'a':'b'},2,3]}) == True #TODO
mmatch({'a':'forefoot'},{'a':' special/foo/'})== True #TODO
mmatch({'a':'forefoot'},{'a':' special/smurf/'}) == False #TODO
mmatch({'a':'forefoot'},{'a':' special/FOO/'})== False #TODO
mmatch({'a':'forefoot'},{'a':' special/FOO/i'})== True #TODO
mmatch({'a':'b'},{}) == True
mmatch({},{}) == True
mmatch({'a':{'b':'c'}},{'a':{}}) == True
mmatch({'a':{'b':'c'}}, {'a':{}, 'x':'y'}) == False
mmatch({'a':{'b':'c'}},{}) == True
mmatch({'a':''},{'a':''}) == True
mmatch({'a':''},{'a':0}) == False
mmatch({'a':'forefoot'},{'a':' specialhuhFOO/i'}) == False


Open up a pull request via, please consider adding tests for any new functionality. To set up the dev environment (assuming you're using [virtualenvwrapper](

$ mkvirtualenv message-match
$ pip install -r dev-requirements.txt
$ py.test


This is a very light-weight and fast library that does some basic but reasonably powerful message matching.



Takes two and only two arguments, both dictionaries, and returns a boolean.


None known.


Copyright (c) 2012, 2013, 2016, 2017 Dana M. Diederich. All Rights Reserved.


Dana M. Diederich

Platform: UNKNOWN
Classifier: Intended Audience :: Developers
Classifier: Development Status :: 5 - Production/Stable
Classifier: Programming Language :: Python :: 2
Classifier: Programming Language :: Python :: 2.7
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.3
Classifier: Programming Language :: Python :: 3.4
Classifier: Programming Language :: Python :: 3.5
Classifier: License :: OSI Approved :: MIT License

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

message-match-1.0.0.tar.gz (3.3 kB view hashes)

Uploaded source

Built Distributions

message_match-1.0.0-py2.py3-none-any.whl (4.4 kB view hashes)

Uploaded py2 py3

message_match-1.0.0-py2.7.egg (3.5 kB view hashes)

Uploaded 2 7

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page