Welcome, guest | Sign In | My Account | Store | Cart

Notice! PyPM is being replaced with the ActiveState Platform, which enhances PyPM’s build and deploy capabilities. Create your free Platform account to download ActivePython or customize Python with the packages you require and get automatic updates.

Download
ActivePython
INSTALL>
pypm install gocept.pseudonymize

How to install gocept.pseudonymize

  1. Download and install ActivePython
  2. Open Command Prompt
  3. Type pypm install gocept.pseudonymize
 Python 2.7Python 3.2Python 3.3
Windows (32-bit)
Windows (64-bit)
Mac OS X (10.5+)
Linux (32-bit)
Linux (64-bit)
0.1 Available View build log
0.1 Available View build log
 
License
ZPL 2.1
Dependencies
Lastest release
version 0.1 on Sep 20th, 2013

gocept.pseudonymize

This package provides helper functions to pseudonymize data like text, integers, email addresses or license tags.

It uses the crypt module for pseudonymization, which means, it is not eligible to pseudonymize long text blocks as the hash generated by crypt is relatively short.

Usage

gocept.pseudonymize provides single functions for pseudonymization of various data types. Each function takes the value, which should be pseudonymized, and a secret, which is passed as a salt to the crypt module. The pseudonymize function return the exact same result, if secret and value do not change:

>>> import gocept.pseudonymize
>>> gocept.pseudonymize.text('asdf', 'secret')
'dugD'

This package is tested to be compatible with Python version 2.7 and 3.3.

Detailed Usage Examples

To pseudonymize integer values, gocept.pseudonymize provides the integer function:

>>> import gocept.pseudonymize
>>> gocept.pseudonymize.integer(4711, 'secret')
1029

To pseudonymize email addresses, gocept.pseudonymize provides the email function:

>>> import gocept.pseudonymize
>>> gocept.pseudonymize.email('mail@gocept.com', 'secret')
'cCSe@7HKlpUc.de'

To pseudonymize IBAN account numbers, gocept.pseudonymize provides the iban function:

>>> import gocept.pseudonymize
>>> gocept.pseudonymize.iban('US00123456787650047623', 'secret')
'DE11912270187105821216'

To pseudonymize license tags, gocept.pseudonymize provides the license_tag function:

>>> import gocept.pseudonymize
>>> gocept.pseudonymize.license('HAL-AB 123', 'secret')
'Z1Y-YV 784'

To pseudonymize license tags, gocept.pseudonymize provides the phone function:

>>> import gocept.pseudonymize
>>> gocept.pseudonymize.phone('+49 172 34123142', 'secret')
'0511911912178610'

To pseudonymize decimals, gocept.pseudonymize provides the decimal function:

>>> from decimal import Decimal
>>> import gocept.pseudonymize
>>> gocept.pseudonymize.decimal(Decimal('-123.45'), 'secret')
Decimal('-8799.11')

To pseudonymize a date, gocept.pseudonymize provides the date function:

>>> from datetime import date
>>> import gocept.pseudonymize
>>> gocept.pseudonymize.date(date(1983, 1, 11), 'secret')
date(9867, 7, 11)

To pseudonymize a time, gocept.pseudonymize provides the time function:

>>> from datetime import time
>>> import gocept.pseudonymize
>>> gocept.pseudonymize.time(time(23, 59, 59), 'secret')
time(11, 46, 49)

Change log for gocept.pseudonymize

0.1 (2013-09-05)

initial release

Subscribe to package updates

Last updated Sep 20th, 2013

Download Stats

Last month:1

What does the lock icon mean?

Builds marked with a lock icon are only available via PyPM to users with a current ActivePython Business Edition subscription.

Need custom builds or support?

ActivePython Enterprise Edition guarantees priority access to technical support, indemnification, expert consulting and quality-assured language builds.

Plan on re-distributing ActivePython?

Get re-distribution rights and eliminate legal risks with ActivePython OEM Edition.