Skip to main content

A module for z-anonymity

Project description

zeta-anonymity

A script that simulates the behaviour of a $z$-anonymity module.

When instantiating the object the constructor receives a $\Delta t$ and a value for $z$.

The anonymize() method accepts a string in the form of a triple $(t,u,a)$ - meaning that at time $t$ a user $u$ exposes an attribute $a$ - and a file object.

If the triple exposes an attribute that has not been exposed by other $z$ - 1 users in the past $deltat$ the triple is simply ignored. Otherwise, the triple is printed on the file object.

example

from zanon import *

file = "trace_products.txt"
deltat = 3600 #in seconds
z = 20

z = zanon(deltat,z)
f = open('simulation_output.txt', 'w+')

for line in open(file, 'r'):
	z.anonymize(line,f)

f.close()

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

zanon-0.1.1.tar.gz (2.6 kB view hashes)

Uploaded Source

Built Distribution

zanon-0.1.1-py3-none-any.whl (15.4 kB view hashes)

Uploaded Python 3

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page