Metadata-Version: 2.1
Name: automapping
Version: 0.0.1
Summary: A utility library to map between dataclass
Home-page: https://github.com/GabrielCpp/automapping
Author: Gabriel
Author-email: gabcpp17@gmail.com
License: UNKNOWN
Download-URL: https://github.com/GabrielCpp/automapping/archive/v0.0.1.tar.gz
Description: Python 3.7 helper tool to work with mapping of dataclasses.
        
        
        
        It allow automapping a dataclass attributes
        
        ```python
        from automapping import Mapper, Rename
        
        @dataclass
        class InnerA:
            number: int
            list_of_values: List[str]
            untyped_list: list
        
        
        @dataclass
        class A:
            name: str
            id_a: int
            inner: InnerA
        
        
        @dataclass
        class InnerB:
            number: int
            list_of_values: List[str]
            untyped_list: list
        
        
        @dataclass
        class B:
            name: str
            id_b: int
            inner: InnerB
        
        mapper = Mapper()
        mapper.add_mapper(AutoMap(A, B, [
            Rename('id_a', 'id_b')
        ]))
        mapper.add_mapper(AutoMap(InnerA, InnerB))
        
        
        input_a = A(name='Paul', id_a=6, inner=InnerA(
            number=10, list_of_values=['a', 'b'], untyped_list=[1, True]))
        result = mapper.map(input_a, B, ObjectDictTypeUpdater)
        print(result) # B(name='Paul', id_b=6, inner=InnerB(number=10, list_of_values=['a', 'b'], untyped_list=[1, True]))
        
        ```
        
        
        
        
        
        
Platform: UNKNOWN
Classifier: Programming Language :: Python :: 3
Classifier: License :: OSI Approved :: MIT License
Classifier: Operating System :: OS Independent
Requires-Python: >=3.7
Description-Content-Type: text/markdown
