Skip to main content

Build Status Coverage Status Codacy Badge BCH compliance Pypi

Django app to obfuscate text data.

Table of contents:

Compatibility

Tested with python 2.7, 3.4, 3.5, 3.6 and Django 1.9, 1.10, 1.11: Travis CI

How to install

To install the app run:

$ pip install django-obfuscate

or add it to the list of requirements of your project.

Then add ‘obfuscator’ to your INSTALLED_APPS.

INSTALLED_APPS = [
    ...
    'obfuscator',
]

Example usage

On you django project settings, configure the model names and field names to be obfuscated:

OBFUSCATOR = {
    'FIELDS': {
        'app_label.ModelClass1': ['field1', 'field2', 'field3'],
        'app_label.ModelClass2': ['field1'],
        // ...
    }
}

Run the management command to start obfuscation:

$ python manage.py obfuscate

You can run the management command passing as arguments: a model class path and a list of fields to obfuscate (thus will ignore FIELDS setting):

$ python manage.py obfuscate --model=app_label.ModelClass1 --fields=field1, field2, field3

Settings reference

OBFUSCATOR_CLASS

Default: obfuscator.utils.ObfuscatorUtils

Path to class where obfuscator methods are defined. By default, the class define tow obfuscator methods: * text - Obfuscate simple text data, respecting max-length field parameter; * email - Obfuscate email data. Only text before @ is obfuscated, respecting max-length field parameter.

This class also define an obfuscate method. This method use fields mapping (see FIELDS_MAPPING setting) to route the field type with the obfuscate method.

You can redefine this class by subclassing the default class and changing this setting to point to your class.

FIELDS_MAPPING

Default:

{
    models.CharField: 'text',
    models.TextField: 'text',
    models.EmailField: 'email'
}

Map django model field types with obfuscator methods.

FIELDS

Default: {}

Fields to be obfuscated and respective model class path. Must be a dict with keys as python dot notation to path where the models are declared and the values must be declared as lists of model fields.

If no value defined, the management command will do nothing.

Example:

{
    'contenttypes.ContentType': ['model', 'label'],
    // ...
}

License

MIT license, see the LICENSE file. You can use obfuscator in open source projects and commercial products.

Metadata

Release files for django-obfuscate 0.1.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for django-obfuscate 0.1.2
File Size Uploaded Provenance Actions
django-obfuscate-0.1.2.tar.gz 6.9 kB Without provenance Details for django-obfuscate-0.1.2.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for django-obfuscate 0.1.2
File Interpreter ABI Platform Actions
django_obfuscate-0.1.2-py2.py3-none-any.whl Python 3, Python 2 none any Details for django_obfuscate-0.1.2-py2.py3-none-any.whl

Total release size: 18.1 kB

Release files / django-obfuscate-0.1.2.tar.gz

Download URL django-obfuscate-0.1.2.tar.gz
Size 6.9 kB
Tags Source
SHA-256 checksum
How to use checksums
6b5fc81ded102a64d17477ed888f3343108649bbd6620eb23ff7edc580652fdd
BLAKE2b-256 checksum
How to use checksums
36efd1f8cc43e6fa7331db75cffbd4bac88cfb24d50a86fca3cc5f98e5e6fbd1
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Release files / django_obfuscate-0.1.2-py2.py3-none-any.whl

Download URL django_obfuscate-0.1.2-py2.py3-none-any.whl
Size 11.3 kB
Tags Python 2 Python 3
SHA-256 checksum
How to use checksums
ac776212c2aec43fdc351d181f508e27a322a11b52a72235e7ff02c253b532cc
BLAKE2b-256 checksum
How to use checksums
9d3e51cd7fb080ff0b59a48c30d92361a046cc26e39aba666e4ace56744398a9
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No

Security for django-obfuscate 0.1.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page