Skip to main content

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


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

map_object-1.1.1-py3-none-any.whl (3.1 kB view details)

Uploaded Python 3

map_object-1.1.1-py2-none-any.whl (3.1 kB view details)

Uploaded Python 2

File details

Details for the file map_object-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for map_object-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 19de036aa5b9886697d6b4e46848c96726d9a43646097629823353dcc2eb4a80
MD5 fee0d4d2dd19b7b0dee046dfb08fa846
BLAKE2b-256 a5f68340776bf379c91f42225c950f67e7ae0cd54bfc8ff52c342df00c8725ad

See more details on using hashes here.

File details

Details for the file map_object-1.1.1-py2-none-any.whl.

File metadata

File hashes

Hashes for map_object-1.1.1-py2-none-any.whl
Algorithm Hash digest
SHA256 5600282808ac0f879e0fd8037d265f6bf7b39639e58c51628d9cb70244b95ded
MD5 c9263360c21da95c9e69e56383f63dfd
BLAKE2b-256 4faea6d832389da209be801b0855001cabc8383fe1c876c109d761624298e502

See more details on using hashes here.

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