Fast, simple message matching
Project description
History
-------
1.0.0
+++++
released 26-July-2017
- Initial Release
Home-page: https://github.com/dana/python-message-match
Author: Dana M. Diederich
Author-email: dana@realms.org
License: MIT
Description: message-match
=============
Fast, simple message matching
Usage
=====
Usage::
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
Contributing
============
Open up a pull request via https://github.com/dana/python-message-match, please consider adding tests for any new functionality. To set up the dev environment (assuming you're using [virtualenvwrapper](http://docs.python-guide.org/en/latest/dev/virtualenvs/#virtualenvwrapper))::
$ mkvirtualenv message-match
$ pip install -r dev-requirements.txt
$ py.test
Description
===========
This is a very light-weight and fast library that does some basic but reasonably powerful message matching.
Function
========
Function::
mmatch(message,match)
Takes two and only two arguments, both dictionaries, and returns a boolean.
Bugs
====
None known.
Copyright
=========
Copyright (c) 2012, 2013, 2016, 2017 Dana M. Diederich. All Rights Reserved.
Author
======
Dana M. Diederich diederich@gmail.com dana@realms.org
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
-------
1.0.0
+++++
released 26-July-2017
- Initial Release
Home-page: https://github.com/dana/python-message-match
Author: Dana M. Diederich
Author-email: dana@realms.org
License: MIT
Description: message-match
=============
Fast, simple message matching
Usage
=====
Usage::
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
Contributing
============
Open up a pull request via https://github.com/dana/python-message-match, please consider adding tests for any new functionality. To set up the dev environment (assuming you're using [virtualenvwrapper](http://docs.python-guide.org/en/latest/dev/virtualenvs/#virtualenvwrapper))::
$ mkvirtualenv message-match
$ pip install -r dev-requirements.txt
$ py.test
Description
===========
This is a very light-weight and fast library that does some basic but reasonably powerful message matching.
Function
========
Function::
mmatch(message,match)
Takes two and only two arguments, both dictionaries, and returns a boolean.
Bugs
====
None known.
Copyright
=========
Copyright (c) 2012, 2013, 2016, 2017 Dana M. Diederich. All Rights Reserved.
Author
======
Dana M. Diederich diederich@gmail.com dana@realms.org
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
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
message-match-1.0.0.tar.gz
(3.3 kB
view hashes)
Built Distributions
message_match-1.0.0-py2.7.egg
(3.5 kB
view hashes)
Close
Hashes for message_match-1.0.0-py2.py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | b9bb8b1848bd814ec88876a20af1f9c40a4f4ba583fc4ef9d653376d152e7736 |
|
MD5 | 8eb0103192e355d2302bfd6ce0480d94 |
|
BLAKE2b-256 | 7b8fe17bbb9be1ae5e91528394c18101f6c6a7d63c73d2543e341adc482be530 |