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 hashes)

Uploaded Python 3

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

Uploaded Python 2

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