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.
Source Distributions
No source distribution files available for this release.See tutorial on generating distribution archives.
Built Distributions
File details
Details for the file map_object-1.1.1-py3-none-any.whl
.
File metadata
- Download URL: map_object-1.1.1-py3-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 19de036aa5b9886697d6b4e46848c96726d9a43646097629823353dcc2eb4a80 |
|
MD5 | fee0d4d2dd19b7b0dee046dfb08fa846 |
|
BLAKE2b-256 | a5f68340776bf379c91f42225c950f67e7ae0cd54bfc8ff52c342df00c8725ad |
File details
Details for the file map_object-1.1.1-py2-none-any.whl
.
File metadata
- Download URL: map_object-1.1.1-py2-none-any.whl
- Upload date:
- Size: 3.1 kB
- Tags: Python 2
- Uploaded using Trusted Publishing? No
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 5600282808ac0f879e0fd8037d265f6bf7b39639e58c51628d9cb70244b95ded |
|
MD5 | c9263360c21da95c9e69e56383f63dfd |
|
BLAKE2b-256 | 4faea6d832389da209be801b0855001cabc8383fe1c876c109d761624298e502 |