From 59c4b713d093a75e63b9261ac179bde5232802f8 Mon Sep 17 00:00:00 2001 From: "taisuke.fujita" Date: Sat, 21 Sep 2024 08:58:27 +0900 Subject: [PATCH] update --- README.md | 25 +++++++++++++++---------- pyproject.toml | 14 ++++++++++---- 2 files changed, 25 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 7e8821d..ab14aca 100644 --- a/README.md +++ b/README.md @@ -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 @@ -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/* +``` diff --git a/pyproject.toml b/pyproject.toml index 747b467..b0e0bc2 100644 --- a/pyproject.toml +++ b/pyproject.toml @@ -1,10 +1,16 @@ [project] name = "anonypy" -version = "0.2.0" +version = "0.2.1" +authors = [{ name="glassonion1", email="glassonion999@gmail.com" }] +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 = [] \ No newline at end of file +py-modules = [] +[project.urls] +Homepage = "https://github.com/glassonion1/anonypy" +"Bug Tracker" = "https://github.com/glassonion1/anonypy/issues" \ No newline at end of file