Skip to main content

A mapping tool from model to dictionary.

Project description

https://travis-ci.org/tokibito/bpmappers.png?branch=master

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.7.tar.gz (196.3 kB view details)

Uploaded Source

Built Distributions

bpmappers-0.7-py33-none-any.whl (17.2 kB view details)

Uploaded Python 3.3

bpmappers-0.7-py27-none-any.whl (17.2 kB view details)

Uploaded Python 2.7

bpmappers-0.7-py3.3.egg (47.2 kB view details)

Uploaded Source

bpmappers-0.7-py3.2.egg (44.2 kB view details)

Uploaded Source

bpmappers-0.7-py2.7.egg (43.0 kB view details)

Uploaded Source

bpmappers-0.7-py2.6.egg (43.1 kB view details)

Uploaded Source

bpmappers-0.7-py2.5.egg (43.2 kB view details)

Uploaded Source

File details

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

File metadata

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

File hashes

Hashes for bpmappers-0.7.tar.gz
Algorithm Hash digest
SHA256 053060dfd2c4844b9cef5dcff4ad3089d6a6511d0d7ef66f0ab66978e3cb458b
MD5 9b3889febcb474641a5106c3292c79cd
BLAKE2b-256 062e2267b7784de8c26d43127d2a64d6d7e86ecdd65f3148755cdd9b5131f8fd

See more details on using hashes here.

File details

Details for the file bpmappers-0.7-py33-none-any.whl.

File metadata

File hashes

Hashes for bpmappers-0.7-py33-none-any.whl
Algorithm Hash digest
SHA256 3c5b477264e5da42c36d5da9d18cc7bbbd8d05772e2feeb8733918f4669ac759
MD5 d10479f7be35807ed1bcf85afecd13c2
BLAKE2b-256 079b1a1cce6f5a85e4ceb6a20ac72a070b5a1f10b2683d00997be3d717e4494b

See more details on using hashes here.

File details

Details for the file bpmappers-0.7-py27-none-any.whl.

File metadata

File hashes

Hashes for bpmappers-0.7-py27-none-any.whl
Algorithm Hash digest
SHA256 b9a94115d536fcee2181e5f243feabe2bc4cb897f417a8a9cbd34937514b9420
MD5 904520c348225f3fe7987b0ca0380aa9
BLAKE2b-256 cb60e5217fec3c9af4fc98fd5d1d547c4b997ed46c7cb15b823c99aa8e6de31c

See more details on using hashes here.

File details

Details for the file bpmappers-0.7-py3.3.egg.

File metadata

  • Download URL: bpmappers-0.7-py3.3.egg
  • Upload date:
  • Size: 47.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for bpmappers-0.7-py3.3.egg
Algorithm Hash digest
SHA256 294d15ab207c7cdc91d9f612d7a813a9a37e15511efd750b24295043c20da19d
MD5 8257670ee4b87e54de12c93e9feca111
BLAKE2b-256 fcb278a29055a863b54221cd1aa392baabe5331aaf87902e9dad29e3b4a9a90f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for bpmappers-0.7-py3.2.egg
Algorithm Hash digest
SHA256 223feeaea20957371c921aed5fa7e033a311b63d589a94da8456c416f0157936
MD5 0f05fe257dce6c506fb76e0e93379c7b
BLAKE2b-256 e7f15b9e419478053d6f1072bc4170cada6e9d1d573460b823a2cdd0b4eba851

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for bpmappers-0.7-py2.7.egg
Algorithm Hash digest
SHA256 4a9cc7edb2a82b7f0b6a18a0cc1b6814fd9beab94868fbecf2245556e7682d4e
MD5 993958c624d28ff492a06ec94c727081
BLAKE2b-256 fc4b3019e6a9a4b315765c85364715f98d4fc72cf184cff13954b63ea4de09cf

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for bpmappers-0.7-py2.6.egg
Algorithm Hash digest
SHA256 bfe273a1565b45e3dda802648108649d5313b51e7bdd182b79843371e15f735d
MD5 bd29ed58a29caf14fb55d471130bc21c
BLAKE2b-256 e6ad77a6f00fd444119eeebeafa51fb4b4d85764425d43de13a6a28d6a07769f

See more details on using hashes here.

File details

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

File metadata

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

File hashes

Hashes for bpmappers-0.7-py2.5.egg
Algorithm Hash digest
SHA256 2d2919e588aeef5ceeba36c87d719e34e92cd011ca3bf3fbdaa82f172e0fa68d
MD5 d5221c4f62d4ccdb103ec0c1f4462987
BLAKE2b-256 afa7cfd772cb0d447f9dd7826b4644b4a24253ea21bd3eba5c54f024edc6164b

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