Ghostpii

raw JSON →
2.0.0 verified Sat May 09 auth: no python

Ghostpii is a Python package for private computation using homomorphic encryption. It provides encrypted hash functions, batching for API calls, and data frame optimization for machine learning. Current version: 2.0.0 (Cheetah), requiring Python >=3.6. Maintenance cadence: irregular.

pip install ghostpii
error ModuleNotFoundError: No module named 'ghostpii'
cause Package not installed or environment issue.
fix
Run 'pip install ghostpii' and ensure you're using the correct Python environment.
error ImportError: cannot import name 'Ghostpii' from 'ghostpii'
cause Wrong import pattern: using 'import ghostpii' instead of 'from ghostpii import Ghostpii'.
fix
Use 'from ghostpii import Ghostpii'.
error TypeError: encrypted_hash() missing required argument: 'data'
cause Calling encrypted_hash without passing data argument.
fix
Pass bytes data: client.encrypted_hash(b"your data")
breaking Version 2.0.0 (Cheetah) introduced breaking changes: batching for API calls and new homomorphically encrypted hash functions. Code written for v1.x may need updates.
fix Update client code to use new batch endpoints and encrypted hash signature. See migration notes in GitHub release.
deprecated Some older API methods are deprecated as of v2.0.0. Check deprecation warnings in logs.
fix Replace deprecated methods with new equivalents documented in the v2.0.0 release notes.
gotcha Requires Python >=3.6; Python 3.5 or older are unsupported and will cause installation errors.
fix Upgrade Python to at least 3.6.

Initialize a Ghostpii client with API key, then compute an encrypted hash.

from ghostpii import Ghostpii
import os

client = Ghostpii(api_key=os.environ.get('GHOSTPII_API_KEY', ''))
# Example: compute encrypted hash
hash_value = client.encrypted_hash(b"test data")
print(hash_value)