skillfed

clickhouse-cityhash

Python-bindings for CityHash, a fast non-cryptographic hash algorithm

clickhouse-cityhash v1.0.2.6 463.4K downloads/30d#6,521 on PyPI10
Permissive license MIT Active released

What it is and what it does

This package wraps Google's CityHash algorithm in Python, specifically forked to match an older version of the algorithm used by ClickHouse servers. CityHash is a fast, non-cryptographic hash function designed for speed rather than cryptographic security, making it suitable for data integrity checks, hash tables, and distributed systems where collision resistance is less critical than performance.

The package is primarily intended as a third-party library for applications that need to hash data using the ClickHouse protocol. It has no runtime dependencies and compiles to native code via C++ and Cython, providing direct access to the underlying hash functions. The maintainers explicitly recommend using the original python-cityhash package for general-purpose hashing needs outside the ClickHouse ecosystem.

Use it for:

  • Hashing data for compatibility with ClickHouse protocol implementations and servers.
  • Computing fast non-cryptographic hashes in performance-critical data processing pipelines.
  • Distributed systems or databases that rely on CityHash for partitioning or sharding.
  • Verifying data integrity in systems already using ClickHouse's hashing scheme.

Worth the install?

AI-flagged interpretation of the facts on this page — verify before relying

Provides Python bindings to CityHash, a fast non-cryptographic hashing algorithm, specifically tuned for ClickHouse protocol compatibility.

Yes, if you are integrating with ClickHouse and need algorithm-version compatibility. The package is actively maintained, has no known vulnerabilities, carries a permissive MIT license, and offers broad platform support via pre-built wheels. Install only if you specifically need ClickHouse protocol compatibility; for general-purpose hashing, use the original python-cityhash package instead.

Install

clickhouse-cityhash on PyPI

pip

pip install clickhouse-cityhash

uv

uv add clickhouse-cityhash

poetry

poetry add clickhouse-cityhash

Installing clickhouse-cityhash

Before you install

Medium install friction due to compiled C++ extensions; pre-built wheels available for common platforms (x86_64, ARM, PowerPC, s390x on Linux/macOS/Windows). Active maintenance with recent release.

License in practice

MIT license permits commercial and private use with minimal restrictions; suitable for most projects.

Quickstart

pip install clickhouse-cityhash

import clickhouse_cityhash
hash_value = clickhouse_cityhash.CityHash64('your_data')

Requires a C++ compiler and build tools during installation if a pre-built wheel is not available for your platform.

Verify before relying

  • Whether the downgraded CityHash algorithm version matches your ClickHouse server version requirements.
  • Performance characteristics compared to the original python-cityhash package for your use case.
  • Compatibility with Python versions beyond those explicitly listed in classifiers (2.7, 3.6).

Package facts

License MIT (permissive)
Python support not specified
Install friction medium — platform-specific wheel
Runtime dependencies none
Maintenance actively maintained — 31 days since the last release
Last repo commit
First released
Downloads 463,446/month — #6,521 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: clickhouse_cityhash-1.0.2.6-cp310-cp310-macosx_10_9_x86_64.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-macosx_11_0_arm64.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-musllinux_1_2_aarch64.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-musllinux_1_2_ppc64le.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-musllinux_1_2_s390x.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-musllinux_1_2_x86_64.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-win32.whl; clickhouse_cityhash-1.0.2.6-cp310-cp310-win_amd64.whl; clickhouse_cityhash-1.0.2.6-cp311-cp311-macosx_10_9_x86_64.whl; clickhouse_cityhash-1.0.2.6-cp311-cp311-macosx_11_0_arm64.whl; clickhouse_cityhash-1.0.2.6-cp311-cp311-manylinux1_x86_64.manylinux_2_28_x86_64.manylinux_2_5_x86_64.whl; clickhouse_cityhash-1.0.2.6-cp311-cp311-manylinux2014_aarch64.manylinux_2_17_aarch64.manylinux_2_28_aarch64.whl; clickhouse_cityhash-1.0.2.6-cp311-cp311-manylinux2014_ppc64le.manylinux_2_17_ppc64le.manylinux_2_28_ppc64le.whl; clickhouse_cityhash-1.0.2.6-cp311-cp311-manylinux2014_s390x.manylinux_2_17_s390x.manylinux_2_28_s390x.whl; clickhouse_cityhash-1.0.2.6-cp311-cp311-musllinux_1_2_aarch64.whl; clickhouse_cityhash-1.0.2.6-cp311-cp311-musllinux_1_2_ppc64le.whl

Keywords: hash, hashing, cityhash

Development Status :: 4 - BetaIntended Audience :: DevelopersIntended Audience :: Science/ResearchLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: C++Programming Language :: CythonProgramming Language :: Python :: 2.7Programming Language :: Python :: 3.6Topic :: InternetTopic :: Scientific/EngineeringTopic :: Scientific/Engineering :: Information AnalysisTopic :: Software DevelopmentTopic :: Software Development :: Libraries :: Python ModulesTopic :: Utilities

Tags

cityhash python bindingsfast non-cryptographic hashingclickhouse hashing librarycityhash wrapperhash algorithm pythonclickhouse protocol hashingcity hash implementation
hashingclickhousenon-cryptographic

More Software Development packages