Skip to main content

A mapping tool from model to dictionary.

Project description

A mapping tool from model to dictionary.

>>> from bpmappers import Mapper, RawField
>>> class SpamMapper(Mapper):
...     spam = RawField('foo')
...     egg = RawField('bar')
...
>>>
>>> SpamMapper(dict(foo=123, bar='abc')).as_dict()
{'egg': 'abc', 'spam': 123}
>>>
>>> class FooModel(object):
...     def __init__(self, foo, bar):
...         self.foo = foo
...         self.bar = bar
...
>>> SpamMapper(FooModel(foo=123, bar='abc')).as_dict()
{'egg': 'abc', 'spam': 123}
>>>
>>> class HogeMapper(Mapper):
...     hoge = RawField('hoge.piyo.fuga')
...
>>> HogeMapper({'hoge': {'piyo': {'fuga': 123}}}).as_dict()
{'hoge': 123}

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

bpmappers-0.6.tar.gz (187.5 kB view details)

Uploaded Source

Built Distributions

bpmappers-0.6-py3.2.egg (52.3 kB view details)

Uploaded Source

bpmappers-0.6-py3.1.egg (51.7 kB view details)

Uploaded Source

bpmappers-0.6-py2.7.egg (51.0 kB view details)

Uploaded Source

bpmappers-0.6-py2.6.egg (51.2 kB view details)

Uploaded Source

bpmappers-0.6-py2.5.egg (51.3 kB view details)

Uploaded Source

File details

Details for the file bpmappers-0.6.tar.gz.

File metadata

  • Download URL: bpmappers-0.6.tar.gz
  • Upload date:
  • Size: 187.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bpmappers-0.6.tar.gz
Algorithm Hash digest
SHA256 4162dfe048df3e7283d5203c82ffb79b7239dc4509096c594fd4dfce54fe6b87
MD5 b9493778663313cbc8bbe679eae05ba6
BLAKE2b-256 063c00d4ff7600fd9643cf7ffe7ec35065ec17a9ee9f7ba84e52ec24d3db00ad

See more details on using hashes here.

File details

Details for the file bpmappers-0.6-py3.2.egg.

File metadata

  • Download URL: bpmappers-0.6-py3.2.egg
  • Upload date:
  • Size: 52.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bpmappers-0.6-py3.2.egg
Algorithm Hash digest
SHA256 17234303730e8a7f262b24b59880b14fd4046aab4931fa7793f46c174565519a
MD5 702c7e57f3fcdccb8992663b380db3fa
BLAKE2b-256 84d7804c67af1377ca10703e8fb4e4528cda9f1a50298537a3bc09667419c2a0

See more details on using hashes here.

File details

Details for the file bpmappers-0.6-py3.1.egg.

File metadata

  • Download URL: bpmappers-0.6-py3.1.egg
  • Upload date:
  • Size: 51.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bpmappers-0.6-py3.1.egg
Algorithm Hash digest
SHA256 9d61d8a617dcaddbbf42bfdb1afa1fe856387a6c28ecf954dfa7b958c16af69b
MD5 f67ca74aaf77860251cf4fbfa3a62e08
BLAKE2b-256 873fd0894b52fcb03e4ee605955330695777ee8fb67391a3d034c12094abb121

See more details on using hashes here.

File details

Details for the file bpmappers-0.6-py2.7.egg.

File metadata

  • Download URL: bpmappers-0.6-py2.7.egg
  • Upload date:
  • Size: 51.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bpmappers-0.6-py2.7.egg
Algorithm Hash digest
SHA256 ad01835c8961cf25d014020c5ed786dd98edb4e0deade371fbd0f087609b7497
MD5 5c612b06119b3a66d4037a772348aaf9
BLAKE2b-256 c60e8f25bc127ab85b5f1288053a47262023dcddd8573fa5ff91236b23025038

See more details on using hashes here.

File details

Details for the file bpmappers-0.6-py2.6.egg.

File metadata

  • Download URL: bpmappers-0.6-py2.6.egg
  • Upload date:
  • Size: 51.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bpmappers-0.6-py2.6.egg
Algorithm Hash digest
SHA256 1bad9a52aae3df90a50e98f5cae45c2391c6f8eb9f3d15c315c266b2a54fe756
MD5 5878e7f0f29e231b417a9ebef8957be8
BLAKE2b-256 1a2744af483341311651a3375e62b074ab27a6cf8a95687b06063225630f1f67

See more details on using hashes here.

File details

Details for the file bpmappers-0.6-py2.5.egg.

File metadata

  • Download URL: bpmappers-0.6-py2.5.egg
  • Upload date:
  • Size: 51.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bpmappers-0.6-py2.5.egg
Algorithm Hash digest
SHA256 0544a86d24284904535120e6fcdba3b37623a31d39408b06075ed8a4272760f1
MD5 f392929607ff50d0fa493c2da3bd7610
BLAKE2b-256 66667f528e42ead7b4363683fdec24bdb97fc32b3c8dcf643917486c0df44d8a

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