Skip to main content
This is a pre-production deployment of Warehouse. Changes made here affect the production instance of PyPI (pypi.python.org).
Help us improve Python packaging - Donate today!

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

Project Description

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

Release History

Release History

This version
History Node

0.9

History Node

0.8.2

History Node

0.8

History Node

0.7

History Node

0.6

History Node

0.5.1

History Node

0.5

History Node

0.4

History Node

0.3

History Node

0.2

History Node

0.1

Download Files

Download Files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

File Name & Checksum SHA256 Checksum Help Version File Type Upload Date
bpmappers-0.9-py2.py3-none-any.whl (9.7 kB) Copy SHA256 Checksum SHA256 3.6 Wheel May 30, 2017
bpmappers-0.9.tar.gz (36.5 kB) Copy SHA256 Checksum SHA256 Source May 30, 2017

Supported By

WebFaction WebFaction Technical Writing Elastic Elastic Search Pingdom Pingdom Monitoring Dyn Dyn DNS Sentry Sentry Error Logging CloudAMQP CloudAMQP RabbitMQ Heroku Heroku PaaS Kabu Creative Kabu Creative UX & Design Fastly Fastly CDN DigiCert DigiCert EV Certificate Rackspace Rackspace Cloud Servers DreamHost DreamHost Log Hosting