Skip to main content

Utilities for deduping Django model instances

Project description

Build status codecov

A collection of classes and utilities to aid in de-duping Django model instances.


pip install django-super-deduper


Merging Duplicate Instances

By default any empty values on the primary object will take the value from the duplicates. Additionally, any related one-to-one, one-to-many, and many-to-many related objects will be updated to reference the primary object.

> from django_super_deduper.merge import MergedModelInstance
> primary_object = Model.objects.create(attr_A=None, attr_B='')
> alias_object_1 = Model.objects.create(attr_A=X)
> alias_object_2 = Model.objects.create(attr_B=Y)
> merged_object = MergedModelInstance.create(primary_object, [alias_object_1, alias_object_2])
> merged_object.attr_A
> merged_object.attr_B


  • Support multiple merging strategies


This package does have some rudimentary logging for debugging purposes. Add this snippet to your Django logging settings to enable it:

    'loggers': {
        'django_super_deduper': {
        'handlers': ['console'],
        'level': 'DEBUG',

Project details

Release history Release notifications

This version
History Node


Download files

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

Filename, size & hash SHA256 hash help File type Python version Upload date
django-super-deduper-0.0.5.tar.gz (3.3 kB) Copy SHA256 hash SHA256 Source None Oct 2, 2017

Supported by

Elastic Elastic Search Pingdom Pingdom Monitoring Google Google BigQuery Sentry Sentry Error logging CloudAMQP CloudAMQP RabbitMQ AWS AWS Cloud computing Fastly Fastly CDN DigiCert DigiCert EV certificate StatusPage StatusPage Status page