skillfed

django-anon

Anonymize production data so it can be safely used in not-so-safe environments

django-anon v0.3.2 140.9K downloads/30d#11,260 on PyPI164
Permissive license MIT DORMANT released

What it is and what it does

django-anon is a Django utility that replaces sensitive data in your database with fake or static values, letting you safely share production databases with developers for debugging and performance testing. You define anonymization rules by subclassing BaseAnonymizer and specifying which model fields get which fake values (email, name, phone, etc.), then call run() to apply the changes in bulk across your database.

The package includes built-in fake-data generators (fake_email, fake_name, fake_phone_number, and others) and lets you plug in external libraries like Faker for higher-quality synthetic data. You can also define custom logic per row using lazy attributes or a clean() method, and filter which rows to anonymize via a custom QuerySet. It uses bulk updates under the hood to keep large-table operations fast.

Use it for:

  • Share a production database snapshot with your development team without exposing customer PII or payment information.
  • Set up a realistic test environment that mirrors production data patterns without legal or privacy risks.
  • Reproduce bugs in a production-like database state while keeping sensitive data out of logs and version control.
  • Prepare data for performance testing on real-scale datasets without compliance violations.
  • Anonymize user records before exporting data for analytics or third-party audits.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Anonymizes Django model data in place using bulk operations, replacing sensitive fields with fake or static values to create safe development copies of production databases.

Yes, if you are on Django 1.8–3.0 and Python 2.7 or 3.7. The package is stable and does its job well for bulk anonymization. No, if you need active maintenance or support for newer Django or Python versions—dormancy since 2021 means no updates for newer framework versions. Consider it for legacy projects or as a starting point you may need to fork.

Install

django-anon on PyPI

pip

pip install django-anon

uv

uv add django-anon

poetry

poetry add django-anon

Installing django-anon

Before you install

Low install friction with just two runtime dependencies (django-bulk-update and django-chunkator). Maintenance is dormant—last release was 2021-07-28, so expect no active bug fixes or updates for newer Django versions.

License in practice

MIT license is permissive; you can use, modify, and distribute this package freely in commercial and private projects with minimal restrictions.

Quickstart

pip install django-anon

import anon

class PersonAnonymizer(anon.BaseAnonymizer):
    email = anon.fake_email
    is_admin = False
    class Meta:
        model = Person

PersonAnonymizer().run()

Requires a Django project with models already defined; will modify your current database in place when run() is called.

Verify before relying

  • Whether the package works with Django versions released after 2021 (documented support ends at 3.0)
  • Whether Python 2.7 support remains functional or if the package is effectively Python 3 only in practice
  • Real-world performance on databases larger than those in the maintainer's test suite

Package facts

License MIT (permissive)
Python support not specified
Install friction low — pure-Python wheel
Runtime dependencies 2 — django-bulk-update, django-chunkator
Maintenance dormant — 1,843 days since the last release
Last repo commit
First released
Downloads 140,877/month — #11,260 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: django_anon-0.3.2-py2.py3-none-any.whl

Development Status :: 5 - Production/StableFramework :: DjangoIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 3

Tags

django database anonymizationproduction data maskingbulk data anonymizationdjango fake data generationdatabase privacy tooldevelopment database sanitizationdjango model anonymizer
data-privacydjango-toolbulk-operations

More Database packages

psycopg2-binary

psycopg2-binary is a PostgreSQL database…

copyleft · top 1,000 on PyPI

redis

Python client library for connecting to and…

permissive · top 1,000 on PyPI

ydb

YDB Python SDK is the official client library…

permissive · top 1,000 on PyPI

snowflake-connector-python

Connects Python applications to Snowflake data…

permissive · top 1,000 on PyPI

sqlparse

sqlparse tokenizes SQL text into a tree of…

permissive · top 1,000 on PyPI

dbt-adapters

Provides base adapter protocols and shared…

permissive · top 1,000 on PyPI

Faker

Faker generates realistic fake data—names,…

permissive · top 1,000 on PyPI

presidio-anonymizer

Replaces detected PII text entities with…

permissive · top 5,000 on PyPI

fake-factory

fake-factory is a deprecated package that…

permissive · top 15,000 on PyPI

django-bulk-update

Performs bulk updates of Django ORM objects in…

permissive · top 15,000 on PyPI

django-fernet-fields-v2

Provides Fernet symmetric encryption for Django…

permissive · top 5,000 on PyPI

djangorestframework-bulk

Adds bulk create, update, and delete operations…

permissive · top 15,000 on PyPI

django-nonrelated-inlines

Provides Django admin inline classes that let…

permissive · top 15,000 on PyPI

django-pg-returning

Extends Django's ORM to capture and return rows…

permissive · top 15,000 on PyPI

faker-edu

Generates fake data for educational…

permissive · top 15,000 on PyPI

faker-nonprofit

Extends Faker with methods to generate…

permissive · top 15,000 on PyPI