Skip to content

Latest commit

 

History

History
43 lines (29 loc) · 1.12 KB

README.rst

File metadata and controls

43 lines (29 loc) · 1.12 KB

Diff & Patch

A simple python package which serves as a framework for diffing and patching complex objects. Inspired by Shreyas Kulkarni and git diff and patch.

Quick links

PyPi: https://pypi.org/project/diff-and-patch/

Source: https://github.com/thulasi-ram/diff-and-patch

Docs: https://github.com/thulasi-ram/diff-and-patch

Quick Usage

See examples

from examples.car import Car, Engine, Passenger
from examples.update_car_service import UpdateCarService

engine = Engine(model='RAWWR')
John = Passenger('John')
Doe = Passenger('Doe')
old_car = Car(
    engine=engine,
    passengers=[John, Doe],
)

new_engine = Engine(model='SUPER_RAWWR')
Anne = Passenger('Anne')
new_car = Car(
    engine=engine,
    passengers=[John, Doe, Anne],
)

UpdateCarService(old_car).update(new_car)