{ "info": { "author": "Matthew Wilkes", "author_email": "matt@matthewwilkes.name", "bugtrack_url": null, "classifiers": [ "Programming Language :: Python" ], "description": "A django add-on that allows models to be decorated with information about which fields contain sensitive information, and an associated management command that creates a script to remove that information.\n\n.. image:: https://travis-ci.org/MatthewWilkes/django-scrub-pii.svg?branch=master\n :target: https://travis-ci.org/MatthewWilkes/django-scrub-pii\n\n.. image:: https://coveralls.io/repos/github/MatthewWilkes/django-scrub-pii/badge.svg?branch=master\n :target: https://coveralls.io/github/MatthewWilkes/django-scrub-pii?branch=master\n\n\nINSTALL\n=======\n\n::\n\n $ pip install django-scrub-pii\n\nUSAGE\n=====\n\nAdd scrubpii to your settings file:\n\n.. code :: python\n\n INSTALLED_APPS = (\n ...,\n ...,\n ...,\n 'scrubpii',\n )\n\nSensitive fields are marked by adding a `sensitive_fields` list to the model's Meta class. As the fields in the Meta class are fixed, Django needs to be patched to allow the new field. To ensure isolation and warn if compatibility problems happen in future, this is achieved by defining the model within a context manager:\n\n.. code :: python\n\n from scrubpii import allow_sensitive_fields\n \n with allow_sensitive_fields():\n class Person(models.Model):\n first_name = models.CharField(max_length=30)\n last_name = models.CharField(max_length=30)\n date_of_birth = models.DateField()\n email = models.EmailField()\n\n def __unicode__(self):\n return \"{0} {1}\".format(self.first_name, self.last_name)\n\n class Meta:\n sensitive_fields = {'last_name', 'first_name', 'email', 'date_of_birth'}\n\nThis can be achieved easily by separating the sensitive models out into a new file, as so:\n\n.. code :: python\n\n from django.db import models\n from scrubpii import allow_sensitive_fields\n \n with allow_sensitive_fields():\n from .sensitive_models import *\n\nwhere `sensitive_models.py` is:\n\n.. code :: python\n\n from django.db import models\n \n __all__ = ['Person']\n \n class Person(models.Model):\n first_name = models.CharField(max_length=30)\n last_name = models.CharField(max_length=30)\n date_of_birth = models.DateField()\n email = models.EmailField()\n\n def __unicode__(self):\n return \"{0} {1}\".format(self.first_name, self.last_name)\n\n class Meta:\n sensitive_fields = {'last_name', 'first_name', 'email', 'date_of_birth'}\n\n\nIf you need to mark fields on third party models as sensitive you can do so using settings.py:\n\n.. code :: python\n\n SCRUB_PII_ADDITIONAL_FIELDS = {'auth.User': {'email',\n 'first_name',\n 'last_name',\n 'password',\n 'username',\n },\n 'testapp.Book': {'title', },\n 'testapp.Example': {'foo', }\n }\n\nOnce the sensitive fields are defined a management command will generate SQL statements to anonymize a database. This app will not anonymize the database directly to avoid the risk of damaging live data.\n\nThe script can be generated by running the management command:\n\n::\n\n $ python manage.py get_sensitive_data_removal_script > scrub.sql\n\nThe suggested workflow is:\n\n1. Dump database\n2. Reload dump into a temporary database on a secure server (or copy sqlite.db if sqlite)\n3. Generate anonymisation script\n4. Run anonymisation script against temporary database\n5. Dump temporary database\n6. Delete temporary database\n7. Transmit temporary database to insecure server\n\nSUPPORTED DATABASES\n===================\n\nCurrently, postgresql and sqlite only are supported. Patches to add other databases or fields welcome.\n\nNote, the anonymisation under sqlite is more comprehensive than under postgresql. For example, under sqlite IP addresses will be anonymised to the same value, whereas under postgres different IPs will be anonymised to differing values.\n\nDEVELOP\n=======\n\n::\n\n $ git clone django-scrub-pii\n $ cd django-scrub-pii\n $ make\n\nRUNNING TESTS\n=============\n\n::\n\n $ tox\n\n\n\nChangelog\n=========\n\n\n1.1.3 (2016-01-29)\n----------------\n\n- Add support for later postgres versions.\n [MatthewWilkes]\n\n\n1.1.2 (2016-01-29)\n----------------\n\n- Add TextField to the types that can be sanitised.\n [MatthewWilkes]\n\n\n1.1.1 (2016-01-29)\n----------------\n\n- Fix a bug in 1.1 that meant the additional sensitive fields on model setting was an all-or-nothing affair.\n [MatthewWilkes]\n\n\n1.1 (2016-01-29)\n----------------\n\n- Allow specification of additional model fields to treat as sensitive using django settings.\n [MatthewWilkes]\n\n\n1.0 (2016-01-29)\n----------------\n\n- Initial release, basic support for built in field types, especially on postgres. Limited sqlite support.\n [MatthewWilkes]\n\n::\n\n django-scrub-pii Copyright (c) 2016, Matthew Wilkes\n All rights reserved.\n \n Redistribution and use in source and binary forms, with or without\n modification, are permitted provided that the following conditions\n are met:\n 1. Redistributions of source code must retain the above copyright\n notice, this list of conditions and the following disclaimer.\n 2. Redistributions in binary form must reproduce the above copyright\n notice, this list of conditions and the following disclaimer in the\n documentation and/or other materials provided with the distribution.\n 3. The name of the author may not be used to endorse or promote products\n derived from this software without specific prior written permission.\n \n THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR\n IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES\n OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.\n IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,\n INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT\n NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,\n DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY\n THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT\n (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF\n THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.", "description_content_type": null, "docs_url": null, "download_url": "UNKNOWN", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "UNKNOWN", "keywords": null, "license": "BSD", "maintainer": null, "maintainer_email": null, "name": "django-scrub-pii", "package_url": "https://pypi.org/project/django-scrub-pii/", "platform": "UNKNOWN", "project_url": "https://pypi.org/project/django-scrub-pii/", "project_urls": { "Download": "UNKNOWN", "Homepage": "UNKNOWN" }, "release_url": "https://pypi.org/project/django-scrub-pii/1.1.3/", "requires_dist": null, "requires_python": null, "summary": "A django add-on that allows models to be decorated with information about which fields contain sensitive information, and an associated management command that creates a script to remove that information.", "version": "1.1.3" }, "last_serial": 1929718, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "6772c32c874c184600613e776990b302", "sha256": "6cd9e4be6bf1af44c447e96e63cc5f6214596d475585e33f2aa676ccc36c157a" }, "downloads": -1, "filename": "django_scrub_pii-1.0-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "6772c32c874c184600613e776990b302", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 21745, "upload_time": "2016-01-29T11:45:11", "url": "https://files.pythonhosted.org/packages/05/6b/55f9460ef9b38b6e803e0cc9419f3b06db333ffc55c8c73662e40cb47fd5/django_scrub_pii-1.0-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ee0e211f6d493bbde3b0c60b577e348d", "sha256": "856d5f475483afc6160e94d2e73615ce377a4a3dd020e48570e1e14be2b89a04" }, "downloads": -1, "filename": "django-scrub-pii-1.0.tar.gz", "has_sig": false, "md5_digest": "ee0e211f6d493bbde3b0c60b577e348d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12098, "upload_time": "2016-01-29T11:45:05", "url": "https://files.pythonhosted.org/packages/84/ae/f6e0500579525758538a076428c7e51d12830a5d7c880796f7bcf531a85e/django-scrub-pii-1.0.tar.gz" } ], "1.1": [ { "comment_text": "", "digests": { "md5": "318dcd98d8470647b0fb82f40a520b39", "sha256": "2805c90bbcbec111ae4c1c30a9d0f7daa42594c6aa257089c79c80dc6934006c" }, "downloads": -1, "filename": "django_scrub_pii-1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "318dcd98d8470647b0fb82f40a520b39", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 22713, "upload_time": "2016-01-29T15:56:51", "url": "https://files.pythonhosted.org/packages/64/4d/74808d3a35d5425e19995f69aa4e8edc22f38f3a03d51f4fe6937b1af5e3/django_scrub_pii-1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "a31f062fe4cfab9f7fcd65afeb937037", "sha256": "427249cc307123094b80096e11c1c81393c0e91ece540b922e151d31bf28b4ef" }, "downloads": -1, "filename": "django-scrub-pii-1.1.tar.gz", "has_sig": false, "md5_digest": "a31f062fe4cfab9f7fcd65afeb937037", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12772, "upload_time": "2016-01-29T15:56:46", "url": "https://files.pythonhosted.org/packages/48/f3/e46afcb3e854ad54c1c1c588ee82b21306c440c921b50371ab485e374c46/django-scrub-pii-1.1.tar.gz" } ], "1.1.1": [ { "comment_text": "", "digests": { "md5": "d1579b569dd907427607cb2b5260d5f1", "sha256": "0f015f7ef3cf3c799a6c804bbdafa73aca2b813fd583f0af65cb0c8bdc3b0ef9" }, "downloads": -1, "filename": "django_scrub_pii-1.1.1-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "d1579b569dd907427607cb2b5260d5f1", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 22882, "upload_time": "2016-01-29T16:47:55", "url": "https://files.pythonhosted.org/packages/51/c2/ef3ad411b24450ae9aaa9dfc1554e033ef23d3726319afa5644f7628d1d2/django_scrub_pii-1.1.1-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "ad869055504aeec3d0ca7a02964dedee", "sha256": "ef42a8a1049c8850488b86a0cdbafeb0f125cb3869bf04b0b022efd464f975d0" }, "downloads": -1, "filename": "django-scrub-pii-1.1.1.tar.gz", "has_sig": false, "md5_digest": "ad869055504aeec3d0ca7a02964dedee", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 12892, "upload_time": "2016-01-29T16:47:44", "url": "https://files.pythonhosted.org/packages/de/3c/5e05f9f3576c3bed8f32dababbc94cb2a04da25426c5fde710a5a95a1d99/django-scrub-pii-1.1.1.tar.gz" } ], "1.1.2": [ { "comment_text": "", "digests": { "md5": "65665a9cf05bada3398da6b3c0c29814", "sha256": "8ce87a3c679e05ba9b7d8edce15df23c2c689e6174f25a3eebd5167ef58793d4" }, "downloads": -1, "filename": "django_scrub_pii-1.1.2-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "65665a9cf05bada3398da6b3c0c29814", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 23859, "upload_time": "2016-01-29T17:00:20", "url": "https://files.pythonhosted.org/packages/d9/ad/b0a6251f983dc9f12c505513b26eb1bd7b84893ded869cf3c3423a914393/django_scrub_pii-1.1.2-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "4e3390cd0395fb2d32f8e3848f7ec523", "sha256": "3f0f2694de4895ece49cd29f1f0c439720126c85c5776a8c52bb1d6d24cba0a6" }, "downloads": -1, "filename": "django-scrub-pii-1.1.2.tar.gz", "has_sig": false, "md5_digest": "4e3390cd0395fb2d32f8e3848f7ec523", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13362, "upload_time": "2016-01-29T16:59:59", "url": "https://files.pythonhosted.org/packages/91/4e/6c9658f183aa376cebc5ffd59e088cdd7abc80fb58d4c3f844153c791483/django-scrub-pii-1.1.2.tar.gz" } ], "1.1.3": [ { "comment_text": "", "digests": { "md5": "c22b1c0f7d128cea6a684b0bd3034136", "sha256": "73f2f012e55107b90b1058e2d54271a4f19f4ed37afdb3206c3ab05bec130258" }, "downloads": -1, "filename": "django_scrub_pii-1.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c22b1c0f7d128cea6a684b0bd3034136", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 23876, "upload_time": "2016-01-29T17:20:09", "url": "https://files.pythonhosted.org/packages/5a/5e/db3bde55077bf91f3a8bc0cad60bd26d9386c7af5ccdc78d6b0b41356baf/django_scrub_pii-1.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "69b2e6729fc2634bd9f7dc5cf37825c9", "sha256": "75bd638ebd48e5e9bc5f782dc35f145932ee60cb68980eea82032c21e8692844" }, "downloads": -1, "filename": "django-scrub-pii-1.1.3.tar.gz", "has_sig": false, "md5_digest": "69b2e6729fc2634bd9f7dc5cf37825c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13377, "upload_time": "2016-01-29T17:19:46", "url": "https://files.pythonhosted.org/packages/03/c6/387df11319fc62d7b5d0ef6d0608392d6a0dd19ad867fa6d2a3bddab1acb/django-scrub-pii-1.1.3.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "c22b1c0f7d128cea6a684b0bd3034136", "sha256": "73f2f012e55107b90b1058e2d54271a4f19f4ed37afdb3206c3ab05bec130258" }, "downloads": -1, "filename": "django_scrub_pii-1.1.3-py2.py3-none-any.whl", "has_sig": false, "md5_digest": "c22b1c0f7d128cea6a684b0bd3034136", "packagetype": "bdist_wheel", "python_version": "2.7", "requires_python": null, "size": 23876, "upload_time": "2016-01-29T17:20:09", "url": "https://files.pythonhosted.org/packages/5a/5e/db3bde55077bf91f3a8bc0cad60bd26d9386c7af5ccdc78d6b0b41356baf/django_scrub_pii-1.1.3-py2.py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "69b2e6729fc2634bd9f7dc5cf37825c9", "sha256": "75bd638ebd48e5e9bc5f782dc35f145932ee60cb68980eea82032c21e8692844" }, "downloads": -1, "filename": "django-scrub-pii-1.1.3.tar.gz", "has_sig": false, "md5_digest": "69b2e6729fc2634bd9f7dc5cf37825c9", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 13377, "upload_time": "2016-01-29T17:19:46", "url": "https://files.pythonhosted.org/packages/03/c6/387df11319fc62d7b5d0ef6d0608392d6a0dd19ad867fa6d2a3bddab1acb/django-scrub-pii-1.1.3.tar.gz" } ] }