Skip to main content

bpmappers is a Python moudle that maps Python dictionary values and object properties to different dictionary.

Project description

build-status pypi docs

bpmappers is a Python moudle that maps Python dictionary values and object properties to different dictionary.

Install

Install using pip.

$ pip install bpmappers

Usage

An example of mapping an instance of the Person class to a dictionary:

>>> class Person:
...     def __init__(self, name, age):
...         self.name = name
...         self.age = age
...     def __repr__(self):
...         return "<Person name={}, age={}>".format(self.name, self.age)
...
>>> p = Person("Spam", 25)
>>> p
<Person name=Spam, age=25>
>>> from bpmappers import Mapper, RawField
>>> class PersonMapper(Mapper):
...     mapped_name = RawField('name')
...     mapped_age = RawField('age')
...
>>> PersonMapper(p).as_dict()
OrderedDict([('mapped_name', 'Spam'), ('mapped_age', 25)])

Requirements

  • Target Python version is 2.7, 3.4, 3.5, 3.6

  • Django>=1.8 (If use Django support)

License

This software is licensed under the MIT License.

Documentation

The latest documentation is hosted at Read The Docs.

https://bpmappers.readthedocs.io/en/stable/

Develop

This project is hosted at Github: https://github.com/beproud/bpmappers

Author

  • BeProud, Inc

Maintainer

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

Uploaded Source

Built Distribution

bpmappers-0.9-py2.py3-none-any.whl (9.7 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

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

File hashes

Hashes for bpmappers-0.9.tar.gz
Algorithm Hash digest
SHA256 d02eb0449308f8a9d5238958739187c5e8ab6baaf1d10218475d61df7dea8018
MD5 c1ca79791e2428669468a10790172f00
BLAKE2b-256 d6d6686bef9a8bb14c8b5a42f7d06b91c2f2bb00f1096a81e43c5c63581cb037

See more details on using hashes here.

File details

Details for the file bpmappers-0.9-py2.py3-none-any.whl.

File metadata

File hashes

Hashes for bpmappers-0.9-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 65877f73d20adbb89854ab7c5b669229706a089dfb3175af0ffba8614e2b7ed4
MD5 87f79dabec85aeaeb2a95a7c152c61f1
BLAKE2b-256 6444f6293ddc775c19f68adae2ee6d70dfba76cd35f9a645d548dfaa18de8b34

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