{ "info": { "author": "marazt", "author_email": "marazt@gmail.com", "bugtrack_url": null, "classifiers": [ "Development Status :: 5 - Production/Stable", "Intended Audience :: Developers", "License :: OSI Approved :: MIT License", "Programming Language :: Python :: 2", "Programming Language :: Python :: 2.7", "Programming Language :: Python :: 3", "Programming Language :: Python :: 3.3", "Programming Language :: Python :: 3.4", "Programming Language :: Python :: 3.5", "Programming Language :: Python :: 3.6", "Topic :: Software Development :: Build Tools" ], "description": "Object Mapper\n=============\n\n**Version** 1.1.0\n\n**Author** marazt\n\n**Copyright** marazt\n\n**License** The MIT License (MIT)\n\n**Last updated** 13 July 2019\n\n\n**Package Download** https://pypi.python.org/pypi/object-mapper ---\n\nVersions\n--------\n\n**1.1.0 - 2019/07/13**\n\n- Add basic support for nested object, thanks [@direbearform](https://github.com/direbearform)\n\n**1.0.7 - 2019/06/19**\n\n- Fix type name inside mapper dict to avoid collision, thanks [@renanvieira](https://github.com/renanvieira)\n\n**1.0.6 - 2018/10/28**\n\n- Added ability to specify excluded fields, thanks [@uralov](https://github.com/uralov)\n\n**1.0.5 - 2018/02/21**\n\n- Support for dynamic properties [@nijm](https://github.com/nijm)\n\n**1.0.4 - 2017/11/03**\n\n- Migration to new Pypi.org deployment\n\n**1.0.3 - 2015/05/15**\n\n- Added support for None mapping [@ramiabughazaleh](https://github.com/ramiabughazaleh)\n\n**1.0.2 - 2015/05/06**\n\n- Added support for case insensitivity mapping [@ramiabughazaleh](https://github.com/ramiabughazaleh)\n\n**1.0.1 - 2015/02/19**\n\n- Fix of the package information\n\n**1.0.0 - 2015/02/19**\n\n- Initial version\n\nAbout\n-----\n\n**ObjectMapper** is a class for automatic object mapping inspired by .NET **AutoMapper**. It helps you to create objects between project layers (data layer, service layer, view) in a simple, transparent way.\n\nExample\n-------\n\n1. **Mapping of the properties without mapping definition**\n\nIn this case are mapped only these properties of the target class which are in target and source classes. Other properties are not mapped. Suppose we have class ``A`` with attributes ``name`` and ``last_name`` and class ``B`` with attribute ``name``. Initialization of the ObjectMapper will be:\n\n``python mapper = ObjectMapper() mapper.create_map(A, B) instance_b = mapper.map(A(), B)``\n\nIn this case, value of A.name will be copied into B.name.\n\n2. **Mapping with defined mapping functions**\n\nSuppose we have class ``A`` with attributes ``first_name`` and ``last_name`` , class ``B`` with attribute ``full_name`` and class ``C`` with attribute reverse\\_name. And want to map it in a way ``B.full_name = A.first_name + A.last_name`` and ``C.reverse_name = A.last_name + A.first_name`` Initialization of the ObjectMapper will be:\n\n\\`\\`\\`python mapper = ObjectMapper() mapper.create\\_map(A, B, {'name': lambda a : a.first\\_name + \" \" + a.last\\_name}) mapper.create\\_map(A, C, {'name': lambda a : a.last\\_name + \" \" + a.first\\_name})\n\ninstance\\_b = mapper.map(A(), B) instance\\_c = mapper.map(A(), C) \\`\\`\\`\n\nIn this case, to the ``B.name`` will be mapped ``A.first_name + \" \" + A.last_name`` In this case, to the ``C.name`` will be mapped ``A.last_name + \" \" + A.first_name``\n\n3. **Mapping suppression**\n\nFor some purposes, it can be needed to suppress some mapping. Suppose we have class ``A`` with attributes ``name`` and ``last_name`` and class ``B`` with attributes ``name`` and ``last_name``. And we want to map only the ``A.name`` into ``B.name``, but not ``A.last_name`` to ``B.last_name`` Initialization of the ObjectMapper will be:\n\n\\`\\`\\`python mapper = ObjectMapper() mapper.create\\_map(A, B, {'last\\_name': None})\n\ninstance\\_b = mapper.map(A(), B) \\`\\`\\`\n\nIn this case, value of A.name will be copied into ``B.name`` automatically by the attribute name ``name``. Attribute ``A.last_name`` will be not mapped thanks the suppression (lambda function is None).\n\n4. **Case insensitive mapping**\n\nSuppose we have class ``A`` with attributes ``Name`` and ``Age`` and class ``B`` with attributes ``name`` and ``age`` and we want to map ``A`` to ``B`` in a way ``B.name`` = ``A.Name`` and ``B.age`` = ``A.Age`` Initialization of the ObjectMapper will be:\n\n``python mapper = ObjectMapper() mapper.create_map(A, B) instance_b = mapper.map(A(), B, ignore_case=True)``\n\nIn this case, the value of A.Name will be copied into B.name and the value of A.Age will be copied into B.age.\n\n**Note:** You can find more examples in tests package\n\nInstallation\n------------\n\n- Download this project\n- Download from Pypi: https://pypi.python.org/pypi/object-mapper\n\nENJOY IT!\n~~~~~~~~~\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/marazt/object-mapper", "keywords": "utils dto object-mapper mapping development", "license": "MIT", "maintainer": "", "maintainer_email": "", "name": "object-mapper", "package_url": "https://pypi.org/project/object-mapper/", "platform": "", "project_url": "https://pypi.org/project/object-mapper/", "project_urls": { "Homepage": "https://github.com/marazt/object-mapper" }, "release_url": "https://pypi.org/project/object-mapper/1.1.0/", "requires_dist": [ "datetime", "nose", "nose ; extra == 'test'" ], "requires_python": "", "summary": "ObjectMapper is a class for automatic object mapping. It helps you to create objects between project layers (data layer, service layer, view) in a simple, transparent way.", "version": "1.1.0" }, "last_serial": 5659303, "releases": { "1.0.0": [ { "comment_text": "", "digests": { "md5": "67d2f590fde71a2db9b7b96ed9095691", "sha256": "789d499649d49a3b396d235ac15739fda0c7af46be956096143351559c250570" }, "downloads": -1, "filename": "object-mapper-1.0.0.zip", "has_sig": false, "md5_digest": "67d2f590fde71a2db9b7b96ed9095691", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5633, "upload_time": "2015-02-15T18:06:42", "url": "https://files.pythonhosted.org/packages/9a/bf/f64ce31b9c4afefeb8cc22ebecd42805de2c924ef7c6ed6620f13f8b4660/object-mapper-1.0.0.zip" } ], "1.0.1": [ { "comment_text": "", "digests": { "md5": "37e4baaf1ca85a4a3115524f8999457e", "sha256": "79c10c02fede8980dd6de4cff5c5e8fb59f63a40c1e4ab659ed67852509ab998" }, "downloads": -1, "filename": "object-mapper-1.0.1.zip", "has_sig": false, "md5_digest": "37e4baaf1ca85a4a3115524f8999457e", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 5837, "upload_time": "2015-02-15T18:12:40", "url": "https://files.pythonhosted.org/packages/1e/6f/16e2b18014efb89a037f17fff27358a6e18d47074d3af8f3ce59d32b0d8f/object-mapper-1.0.1.zip" } ], "1.0.2": [ { "comment_text": "", "digests": { "md5": "291053a5d89c1a16b92365e91e538797", "sha256": "ae4577de58e1669287ade825f82dae3b35494d4e493a57271224b8d7bb0dacf0" }, "downloads": -1, "filename": "object-mapper-1.0.2.zip", "has_sig": false, "md5_digest": "291053a5d89c1a16b92365e91e538797", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 6965, "upload_time": "2015-05-06T07:13:14", "url": "https://files.pythonhosted.org/packages/77/ac/a1d50820d807b0b4e696dbd2dcb67c7bbda1be4c2aeab2b6952c2f1a2059/object-mapper-1.0.2.zip" } ], "1.0.3": [ { "comment_text": "", "digests": { "md5": "6725c50cad08c1ac273aab891a4aac76", "sha256": "2ff3084f8d333fac09efabaf3e7ad35e9be74c7c833ff457c7658a9f4fe22786" }, "downloads": -1, "filename": "object-mapper-1.0.3.zip", "has_sig": false, "md5_digest": "6725c50cad08c1ac273aab891a4aac76", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 7253, "upload_time": "2015-05-15T18:09:52", "url": "https://files.pythonhosted.org/packages/57/f7/2b0f7160269343c6ba0aa5a9ddd7f6c611c77c071473a4ba35de621993eb/object-mapper-1.0.3.zip" } ], "1.0.4": [ { "comment_text": "", "digests": { "md5": "2e75db583d72ab2e3a62bdcfe9888265", "sha256": "a0ba834bdbf84fec35e27ec162568771f73c6e263ebf6e65a484f42f7147d383" }, "downloads": -1, "filename": "object_mapper-1.0.4-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "2e75db583d72ab2e3a62bdcfe9888265", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 9952, "upload_time": "2017-11-03T13:47:47", "url": "https://files.pythonhosted.org/packages/66/43/48077e699a64f13ade37a2ce16f1b3a31c2bcf70ee3eed4494b01a54b8c7/object_mapper-1.0.4-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "07aa5620a63b064526f0326bf9c36b66", "sha256": "66edb32129f47211de5b3d9e19485bd44844de0ae25407533ef3219ec75e388d" }, "downloads": -1, "filename": "object-mapper-1.0.4.tar.gz", "has_sig": false, "md5_digest": "07aa5620a63b064526f0326bf9c36b66", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 8190, "upload_time": "2017-11-03T13:47:48", "url": "https://files.pythonhosted.org/packages/93/90/2610f881572e69a091c799c75ef08b973daa94a1c82ba512eb2c133f71b5/object-mapper-1.0.4.tar.gz" } ], "1.0.5": [ { "comment_text": "", "digests": { "md5": "a830c28e7f6344488e51d28083405a7a", "sha256": "673bf6ba910cfbf3cdf95ca2f0d2ebd938143ea3d8720e4cf2ce84be933cec22" }, "downloads": -1, "filename": "object_mapper-1.0.5-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "a830c28e7f6344488e51d28083405a7a", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10473, "upload_time": "2018-02-21T11:03:31", "url": "https://files.pythonhosted.org/packages/b6/eb/0eb1bf10badb69ae8133f27ad6c71e288c678583f6a478d89353f8a3a4d7/object_mapper-1.0.5-py2.py3-none-any.whl" } ], "1.0.6": [ { "comment_text": "", "digests": { "md5": "59ce528ad555131892c6250a6e2d356d", "sha256": "c899e5e636573ea293347ea77946452eb12fb559d5b739d0750474aa3625d02c" }, "downloads": -1, "filename": "object_mapper-1.0.6-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "59ce528ad555131892c6250a6e2d356d", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 8713, "upload_time": "2018-10-28T12:44:35", "url": "https://files.pythonhosted.org/packages/d8/47/a03aed21a1a15f323fa5ed1b0797e19d56b704a4d1d36750b09987f89ada/object_mapper-1.0.6-py2.py3-none-any.whl" } ], "1.0.7": [ { "comment_text": "", "digests": { "md5": "6cee07ce27c17dfb622db4253c9e4500", "sha256": "423deb0bdfcac8ff5f251b5e7335cba7b961e788291769a265d08212560a66c2" }, "downloads": -1, "filename": "object_mapper-1.0.7-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6cee07ce27c17dfb622db4253c9e4500", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 10210, "upload_time": "2019-06-19T20:33:11", "url": "https://files.pythonhosted.org/packages/31/c1/7989c38f0c2cf11d9b4a408d26caa0f8220d2c7896d562b4f74f61695555/object_mapper-1.0.7-py2.py3-none-any.whl" } ], "1.1.0": [ { "comment_text": "", "digests": { "md5": "1737dce292d93827f6613804f2b9526e", "sha256": "15c657b8bee1a1557bcf6d851eb89112018cc7c5a03ce05eb1808628d651b6bb" }, "downloads": -1, "filename": "object_mapper-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1737dce292d93827f6613804f2b9526e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13761, "upload_time": "2019-08-10T11:46:30", "url": "https://files.pythonhosted.org/packages/2e/63/74cd0f450bea90cd9076d73014d02263edf0f70cccb3ef9ad95d8da3138c/object_mapper-1.1.0-py2.py3-none-any.whl" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "1737dce292d93827f6613804f2b9526e", "sha256": "15c657b8bee1a1557bcf6d851eb89112018cc7c5a03ce05eb1808628d651b6bb" }, "downloads": -1, "filename": "object_mapper-1.1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "1737dce292d93827f6613804f2b9526e", "packagetype": "bdist_wheel", "python_version": "py2.py3", "requires_python": null, "size": 13761, "upload_time": "2019-08-10T11:46:30", "url": "https://files.pythonhosted.org/packages/2e/63/74cd0f450bea90cd9076d73014d02263edf0f70cccb3ef9ad95d8da3138c/object_mapper-1.1.0-py2.py3-none-any.whl" } ] }