Skip to content

Commit

Permalink
update
Browse files Browse the repository at this point in the history
  • Loading branch information
glassonion1 committed Sep 20, 2024
1 parent 28ea9aa commit 59c4b71
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 14 deletions.
25 changes: 15 additions & 10 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,20 +36,19 @@ data = [
columns = ["col1", "col2", "col3", "col4", "col5"]
categorical = set(("col2", "col3", "col4"))

def main():
df = pd.DataFrame(data=data, columns=columns)
df = pd.DataFrame(data=data, columns=columns)

for name in categorical:
df[name] = df[name].astype("category")
for name in categorical:
df[name] = df[name].astype("category")

feature_columns = ["col1", "col2", "col3"]
sensitive_column = "col4"
feature_columns = ["col1", "col2", "col3"]
sensitive_column = "col4"

p = anonypy.Preserver(df, feature_columns, sensitive_column)
rows = p.anonymize_k_anonymity(k=2)
p = anonypy.Preserver(df, feature_columns, sensitive_column)
rows = p.anonymize_k_anonymity(k=2)

dfn = pd.DataFrame(rows)
print(dfn)
dfn = pd.DataFrame(rows)
print(dfn)
```

Original data
Expand Down Expand Up @@ -77,3 +76,9 @@ The created anonymized data is below(Guarantee 2-anonymity).
5 8 2 test3,test2 w 1
6 8 2 test3,test2 x 1
```

## Publish PyPI
```
$ python -m build --wheel .
$ python -m twine upload dist/*
```
14 changes: 10 additions & 4 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
[project]
name = "anonypy"
version = "0.2.0"
version = "0.2.1"
authors = [{ name="glassonion1", email="[email protected]" }]
requires-python = ">=3.10"
readme = "README.md"
description = "Anonymization library for python"
keywords = ["k-anonymity","l-diversity","t-closeness","mondrian"]
[build-system]
requires = ["setuptools"]
build-backend = "setuptools.build_meta"
requires = ["hatchling"]
build-backend = "hatchling.build"
[tool.setuptools]
py-modules = []
py-modules = []
[project.urls]
Homepage = "https://github.com/glassonion1/anonypy"
"Bug Tracker" = "https://github.com/glassonion1/anonypy/issues"

0 comments on commit 59c4b71

Please sign in to comment.