Skip to main content

Fast, simple message transforms

Project description

History
-------
1.1.1
+++++
released 9-August-2018

- added array handling in keys, allowing multiple substitutions
- also test against Python 3.6


1.1.0
+++++
released 13-June-2018

- remove reliance on 'six' package
- much better specials handling
- fixed a bug in integer handling


1.0.8
+++++
released 3-November-2017

- Fix a bug where transform_control args were being lost

1.0.6
+++++
released 2-November-2017

- Fix a dependency problem

1.0.5
+++++
released 2-November-2017

- Key-side transforms
- Fix some type related bugs

1.0.4
+++++
released 1-November-2017

- Properly handling specials

1.0.0
+++++
released 26-July-2017

- Initial Release


Home-page: https://github.com/dana/python-message-transform
Author: Dana M. Diederich
Author-email: dana@realms.org
License: MIT
Description: message-transform
=================

Fast, simple message transformations

Usage
=====

Usage::

from message_transform import mtransform

mtransform({'a':'b'},{'x':'y'}) => {'a':'b','x':'y'}
mtransform({'a':'b'},{'x':'y','c':{'d':'e'}}) => {'a':'b','x':'y','c':{'d':'e'}}
mtransform({'a':'b'},{'x':' specials/$message->{a}'}) => {'a':'b','x':'a'}


message = {'a': 'b', 'c': ['d', 'e']}
mtransform(message, {' specials/x$message->{c}y': 'x'}) => {'a': 'b', 'c': ['d', 'e'], 'xdy': 'x', 'xey': 'y'}

Contributing
============

Open up a pull request via https://github.com/dana/python-message-transform, 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-transform
$ 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 transformations.

Function
========

Function::
mtransform(message,transform)

Takes two and only two arguments, both dictionaries, and mutates the message according to the transform.

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


Download files

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

Source Distribution

message-transform-1.1.1.tar.gz (4.2 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

message_transform-1.1.1-py2.py3-none-any.whl (5.6 kB view details)

Uploaded Python 2Python 3

File details

Details for the file message-transform-1.1.1.tar.gz.

File metadata

  • Download URL: message-transform-1.1.1.tar.gz
  • Upload date:
  • Size: 4.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.9.1 setuptools/20.7.0 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/2.7.12

File hashes

Hashes for message-transform-1.1.1.tar.gz
Algorithm Hash digest
SHA256 b84aa045245be0dda381f42a235a09713d54d360b48903300c959c04a3be63ed
MD5 2544a1ca3d4440ebb9600648478356e0
BLAKE2b-256 8cc2d86379e291b6fcee28f79a1981be6bcccdfaa174a537745bbf37d38be6dd

See more details on using hashes here.

File details

Details for the file message_transform-1.1.1-py2.py3-none-any.whl.

File metadata

  • Download URL: message_transform-1.1.1-py2.py3-none-any.whl
  • Upload date:
  • Size: 5.6 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/1.9.1 pkginfo/1.4.1 requests/2.9.1 setuptools/20.7.0 requests-toolbelt/0.8.0 tqdm/4.15.0 CPython/2.7.12

File hashes

Hashes for message_transform-1.1.1-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5dd112917b3fa8b16c689ed560086a7fb73482ab81dd747f8ed65e82c7265a0c
MD5 2eec83867f13e9d2ad0b8df6a46c00be
BLAKE2b-256 e32d4130ec3027b25bddc742feb626a61beb4b29491f13f17cb7981267258f2f

See more details on using hashes here.

Supported by

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