A method for mapping dict objects as if it were an array
Project description
Map Object
A python implementation of the map-obj function
Installation
pip install map_object
Usage
from map_object import mapObject def mapper (key, value, source): return [value, ley] newObject = mapObject({'foo'='bar'}, mapper); # => {bar: 'foo'}
API
mapObject(source, mapper)
source
Type: Object
Source object to copy properties from.
mapper
Type: Function
Mapping function.
- It has signature mapper(sourceKey, sourceValue, source)
- It must return a two item array: [targetKey, targetValue].
License
MIT
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.
Filename, size | File type | Python version | Upload date | Hashes |
---|---|---|---|---|
Filename, size map_object-1.1.1-py2-none-any.whl (3.1 kB) | File type Wheel | Python version py2 | Upload date | Hashes View |
Filename, size map_object-1.1.1-py3-none-any.whl (3.1 kB) | File type Wheel | Python version py3 | Upload date | Hashes View |
Close
Hashes for map_object-1.1.1-py2-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5600282808ac0f879e0fd8037d265f6bf7b39639e58c51628d9cb70244b95ded |
|
MD5 | c9263360c21da95c9e69e56383f63dfd |
|
BLAKE2-256 | 4faea6d832389da209be801b0855001cabc8383fe1c876c109d761624298e502 |
Close
Hashes for map_object-1.1.1-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19de036aa5b9886697d6b4e46848c96726d9a43646097629823353dcc2eb4a80 |
|
MD5 | fee0d4d2dd19b7b0dee046dfb08fa846 |
|
BLAKE2-256 | a5f68340776bf379c91f42225c950f67e7ae0cd54bfc8ff52c342df00c8725ad |