All Projects → Tesorio → Django Anon

Tesorio / Django Anon

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

Programming Languages

python
139335 projects - #7 most used programming language

Projects that are alternatives of or similar to Django Anon

Django Wiki
A wiki system with complex functionality for simple integration and a superb interface. Store your knowledge with style: Use django models.
Stars: ✭ 1,485 (+991.91%)
Mutual labels:  hacktoberfest, django
Ralph
Ralph is the CMDB / Asset Management system for data center and back office hardware.
Stars: ✭ 1,701 (+1150.74%)
Mutual labels:  hacktoberfest, django
Dynaconf
Configuration Management for Python ⚙
Stars: ✭ 2,082 (+1430.88%)
Mutual labels:  hacktoberfest, django
Saleor
A modular, high performance, headless e-commerce platform built with Python, GraphQL, Django, and React.
Stars: ✭ 14,720 (+10723.53%)
Mutual labels:  hacktoberfest, django
Wagtail
A Django content management system focused on flexibility and user experience
Stars: ✭ 11,387 (+8272.79%)
Mutual labels:  hacktoberfest, django
Evennia
Python MUD/MUX/MUSH/MU* development system
Stars: ✭ 1,309 (+862.5%)
Mutual labels:  hacktoberfest, django
Drf Api Tracking
Fork of aschn/drf-tracking so that we can maintain and release newer versions
Stars: ✭ 117 (-13.97%)
Mutual labels:  hacktoberfest, django
Openwisp Network Topology
Network topology collector and visualizer. Collects network topology data from dynamic mesh routing protocols or other popular networking software like OpenVPN, allows to visualize the network graph, save daily snapshots that can be viewed in the future and more.
Stars: ✭ 67 (-50.74%)
Mutual labels:  hacktoberfest, django
Python Resources 2019
A curated list of Python 3 resources, books, websites, tutorials, code challenges
Stars: ✭ 125 (-8.09%)
Mutual labels:  hacktoberfest, django
Impostor
Django app that enables staff to log in as other users using their own credentials.
Stars: ✭ 124 (-8.82%)
Mutual labels:  hacktoberfest, django
Django Infinite Scroll Pagination
🌀 Pagination based on the seek method / keyset paging / offset-less pagination
Stars: ✭ 90 (-33.82%)
Mutual labels:  hacktoberfest, django
Django Defectdojo
DefectDojo is an open-source application vulnerability correlation and security orchestration tool.
Stars: ✭ 1,926 (+1316.18%)
Mutual labels:  hacktoberfest, django
Ayudapy
Platform to help people help people
Stars: ✭ 79 (-41.91%)
Mutual labels:  hacktoberfest, django
Tutorialdb
A search 🔎 engine for programming/dev tutorials, See it in action 👉
Stars: ✭ 93 (-31.62%)
Mutual labels:  hacktoberfest, django
Django Helpdesk
A Django application to manage tickets for an internal helpdesk. Formerly known as Jutda Helpdesk.
Stars: ✭ 1,198 (+780.88%)
Mutual labels:  hacktoberfest, django
Maria Quiteria
Backend para coleta e disponibilização dos dados 📜
Stars: ✭ 115 (-15.44%)
Mutual labels:  hacktoberfest, django
Sapl
Sistema de Apoio ao Processo Legislativo
Stars: ✭ 63 (-53.68%)
Mutual labels:  hacktoberfest, django
Webargs
A friendly library for parsing HTTP request arguments, with built-in support for popular web frameworks, including Flask, Django, Bottle, Tornado, Pyramid, webapp2, Falcon, and aiohttp.
Stars: ✭ 1,145 (+741.91%)
Mutual labels:  hacktoberfest, django
Water Monitoring System
Water Monitoring System is an IOT based Liquid Level Monitoring system that has mechanisms to keep the user alerted in case of liquid overflow or when tank depletes.
Stars: ✭ 122 (-10.29%)
Mutual labels:  hacktoberfest, django
Django Init
Project template used at Fueled for scaffolding new Django based projects. 💫
Stars: ✭ 126 (-7.35%)
Mutual labels:  hacktoberfest, django

.. BANNERSTART .. Since PyPI does not support raw directives, we remove them from the README .. .. raw directives are only used to make README fancier on GitHub and do not .. contain relevant information to be displayed in PyPI, as they are not tied .. to the current version, but to the current development status .. raw:: html

<p align="center">
  <a href="https://github.com/Tesorio/django-anon">
    <img src="https://raw.githubusercontent.com/Tesorio/django-anon/master/icon.svg?sanitize=true" width="128">
  </a>
</p>

<h1 align="center">django-anon</h1>
<p align="center">
  <strong>
    <img src="https://github.githubassets.com/images/icons/emoji/shipit.png" width="16"> Anonymize production data so it can be safely used in not-so-safe environments
  </strong>
</p>

<p align="center">
  <a href="https://github.com/Tesorio/django-anon/actions?query=branch%3Amaster">
    <img src="https://github.com/Tesorio/django-anon/workflows/CI/badge.svg?branch=master">
  </a>
  <a href="https://django-anon.readthedocs.io/en/latest/">
    <img src="https://readthedocs.org/projects/pip/badge/?version=latest&style=flat">
  </a>
  <a href="https://github.com/Tesorio/django-anon/blob/master/LICENSE.txt">
    <img src="https://img.shields.io/badge/license-MIT-blue.svg">
  </a>
  <a href="https://pypi.org/project/django-anon/">
    <img src="https://img.shields.io/pypi/v/django-anon.svg?color=blue">
  </a>
</p>

<p align="center">
  <a >
    Install
  </a>
  |
  <a href="https://django-anon.readthedocs.io/en/latest/introduction.html#table-of-contents">
    Read Documentation
  </a>
  |
  <a href="https://pypi.org/project/django-anon/">
    PyPI
  </a>
  |
  <a href="https://github.com/Tesorio/django-anon/blob/master/CONTRIBUTING.rst">
    Contribute
  </a>
</p>

.. BANNEREND

django-anon will help you anonymize your production database so it can be shared among developers, helping to reproduce bugs and make performance improvements in a production-like environment.

.. image:: https://raw.githubusercontent.com/Tesorio/django-anon/master/django-anon-recording.gif

.. start-features

Features

.. start-features-table

.. csv-table::

"🚀", "Really fast data anonymization and database operations using bulk updates to operate over huge tables" "🍰", "Flexible to use your own anonymization functions or external libraries like Faker <https://faker.readthedocs.io/en/latest/index.html>" "🐩", "Elegant solution following consolidated patterns from projects like Django <https://djangoproject.com/> and Factory Boy <https://factoryboy.readthedocs.io/en/latest/index.html>_" "🔨", "Powerful. It can be used on any projects, not only Django, not only Python. Really!"

.. end-features-table .. end-features .. start-table-of-contents

Table of Contents

.. contents:: :local:

.. end-table-of-contents .. start-introduction

Installation

.. code::

pip install django-anon

Supported versions

  • Python (2.7, 3.7)
  • Django (1.8, 1.11, 2.2, 3.0)

License

MIT <https://github.com/Tesorio/django-anon/blob/master/LICENSE>_

.. end-introduction .. start-usage

Usage

Use anon.BaseAnonymizer to define your anonymizer classes:

.. code-block:: python

import anon

from your_app.models import Person

class PersonAnonymizer(anon.BaseAnonymizer): email = anon.fake_email

  # You can use static values instead of callables
  is_admin = False

  class Meta:
     model = Person

run anonymizer: be cautious, this will affect your current database!

PersonAnonymizer().run()

Built-in functions


.. code:: python

   import anon

   anon.fake_word(min_size=_min_word_size, max_size=20)
   anon.fake_text(max_size=255, max_diff_allowed=5, separator=' ')
   anon.fake_small_text(max_size=50)
   anon.fake_name(max_size=15)
   anon.fake_username(max_size=10, separator='')
   anon.fake_email(max_size=40, suffix='@example.com')
   anon.fake_url(max_size=50, scheme='http://', suffix='.com')
   anon.fake_phone_number(format='999-999-9999')


Lazy attributes
~~~~~~~~~~~~~~~

Lazy attributes can be defined as inline lambdas or methods, as shown below,
using the ``anon.lazy_attribute`` function/decorator.

.. code-block:: python

   import anon

   from your_app.models import Person

   class PersonAnonymizer(anon.BaseAnonymizer):
      name = anon.lazy_attribute(lambda o: 'x' * len(o.name))

      @lazy_attribute
      def date_of_birth(self):
         # keep year and month
         return self.date_of_birth.replace(day=1)

      class Meta:
         model = Person


The clean method
~~~~~~~~~~~~~~~~

.. code-block:: python

   import anon

   class UserAnonymizer(anon.BaseAnonymizer):
      class Meta:
         model = User

      def clean(self, obj):
         obj.set_password('test')
         obj.save()


Defining a custom QuerySet

A custom QuerySet can be used to select the rows that should be anonymized:

.. code-block:: python

import anon

from your_app.models import Person

class PersonAnonymizer(anon.BaseAnonymizer): email = anon.fake_email

  class Meta:
     model = Person

  def get_queryset(self):
     # keep admins unmodified
     return Person.objects.exclude(is_admin=True)

High-quality fake data


In order to be really fast, **django-anon** uses it's own algorithm to generate fake data. It is
really fast, but the generated data is not pretty. If you need something prettier in terms of data,
we suggest using `Faker <https://faker.readthedocs.io/en/latest/index.html>`_, which can be used
out-of-the-box as the below:

.. code-block:: python

   import anon

   from faker import Faker
   from your_app.models import Address

   faker = Faker()

   class PersonAnonymizer(anon.BaseAnonymizer):
      postalcode = faker.postalcode

      class Meta:
         model = Address

.. end-usage

Changelog
---------

Check out `CHANGELOG.rst <https://github.com/Tesorio/django-anon/blob/master/CHANGELOG.rst>`_ for release notes

Contributing
------------

Check out `CONTRIBUTING.rst <https://github.com/Tesorio/django-anon/blob/master/CONTRIBUTING.rst>`_ for information about getting involved

----

`Icon <icon.svg>`_ made by `Eucalyp <https://www.flaticon.com/authors/eucalyp>`_ from `www.flaticon.com <https://www.flaticon.com/>`_
Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].