diff --git a/Readme.md b/Readme.md index fb9b0c4..7491cfa 100644 --- a/Readme.md +++ b/Readme.md @@ -89,6 +89,8 @@ Mirrors the standard `hashlib` interface for data streams. ```python from keyedstablehash import siphash24 +secret_key = b"\x01" * 16 + s = siphash24(key=secret_key) s.update(b"chunk_one") s.update(b"chunk_two") @@ -107,15 +109,19 @@ import pandas as pd import pyarrow as pa from keyedstablehash import hash_pandas_series, hash_arrow_array +secret_key = b"\x01" * 16 + # --- Pandas --- df = pd.DataFrame({"user_id": ["u1", "u2", "u1"]}) df["hash"] = hash_pandas_series(df["user_id"], key=secret_key) # Result: A Series of uint64 hashes +print(df["hash"]) # --- PyArrow --- arr = pa.array(["alpha", "beta", "gamma"]) hashes = hash_arrow_array(arr, key=secret_key) # Result: A pyarrow.Array(uint64) +print(hashes) ``` diff --git a/pyproject.toml b/pyproject.toml deleted file mode 100644 index 370a559..0000000 --- a/pyproject.toml +++ /dev/null @@ -1,37 +0,0 @@ -[build-system] -requires = ["setuptools>=68", "wheel"] -build-backend = "setuptools.build_meta" - -[project] -name = "keyedstablehash" -version = "0.0.1" -description = "Stable, keyed hashing for Python objects and columnar data (SipHash-like PRF semantics)." -readme = "Readme.md" -requires-python = ">=3.9" -authors = [{ name = "Your Name", email = "you@example.com" }] -classifiers = [ - "Programming Language :: Python :: 3", - "Programming Language :: Python :: 3 :: Only", - "License :: OSI Approved :: MIT License", - "Operating System :: OS Independent", -] -dependencies = [] - -[project.optional-dependencies] -dataframes = ["pandas>=1.5"] -arrow = ["pyarrow>=12.0.0"] -polars = ["polars>=0.20.0"] -dev = ["pytest>=7.0", "pytest-cov"] - -[project.urls] -Homepage = "https://example.com/keyedstablehash" -Repository = "https://example.com/keyedstablehash" - -[tool.setuptools.package-dir] -"" = "src" - -[tool.setuptools.packages.find] -where = ["src"] - -[tool.setuptools.package-data] -"keyedstablehash" = ["py.typed"] diff --git a/setup.py b/setup.py index bf68485..5a3cf2f 100644 --- a/setup.py +++ b/setup.py @@ -2,13 +2,18 @@ setup( name="keyedstablehash", - version="0.0.1", + version="0.0.4", description="Stable, keyed hashing for Python objects and columnar data. Think `stablehash`, but with SipHash-like keyed PRF semantics so hashes are deterministic for a given key and resistant to adversarial inputs.", long_description=open("Readme.md", encoding="utf-8").read(), long_description_content_type="text/markdown", author="Shlok Tadilkar", author_email="shloktadilkar@gmail.com", url="https://github.com/shloktech/keyedstablehash", + project_urls={ + "Source": "https://github.com/shloktech/keyedstablehash", + "Tracker": "https://github.com/shloktech/keyedstablehash/issues", + "Documentation": "https://github.com/shloktech/keyedstablehash#readme", + }, packages=find_packages(where="src"), package_dir={"": "src"}, include_package_data=True,