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 3.6, 3.7, 3.8, 3.9

  • Django 2.2, 3.0, 3.1 (When 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/ja/stable/

Develop

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

Uploaded Source

Built Distribution

bpmappers-1.3-py2.py3-none-any.whl (8.8 kB view details)

Uploaded Python 2 Python 3

File details

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

File metadata

  • Download URL: bpmappers-1.3.tar.gz
  • Upload date:
  • Size: 283.2 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.2

File hashes

Hashes for bpmappers-1.3.tar.gz
Algorithm Hash digest
SHA256 0322bbf7637d0243fe2b8815f7ab9f7bbf974919ed6e4c5f17b83365cba7fe67
MD5 f828b798796ab18bedb89908052cca4f
BLAKE2b-256 b7a570d2aaf3b49c1a1a8eff8e2fc65f641e02bd5615e18e8aa555818f66e072

See more details on using hashes here.

File details

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

File metadata

  • Download URL: bpmappers-1.3-py2.py3-none-any.whl
  • Upload date:
  • Size: 8.8 kB
  • Tags: Python 2, Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/3.8.0 pkginfo/1.8.2 readme-renderer/34.0 requests/2.27.1 requests-toolbelt/0.9.1 urllib3/1.26.9 tqdm/4.63.0 importlib-metadata/4.11.3 keyring/23.5.0 rfc3986/2.0.0 colorama/0.4.4 CPython/3.7.2

File hashes

Hashes for bpmappers-1.3-py2.py3-none-any.whl
Algorithm Hash digest
SHA256 5463895ab9686f6f29df37496f6172cb2edd71d4c712a8ed8e98a6344303334b
MD5 498640a48c137380531906e053dbddfc
BLAKE2b-256 f2671950f4d688a85967d6a258f6d67d58359b215e3c6c04a82c28323f8d40a4

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