HexBytes: Python `bytes` subclass for hex representation

JSON →
library 1.3.1 ·python
verified May 20, 2026 install

HexBytes is a thin wrapper around the Python built-in `bytes` class (version 1.3.1). It extends `bytes` by accepting a wider range of initialization types including `bool`, `int`, `str`, `bytearray`, and `memoryview`. Key features include a 0x-prefixed console representation (`__repr__`) and a `to_0x_hex()` method for consistent 0x-prefixed hexadecimal string output. The library is actively maintained with regular releases.

total hits 11
actors 6 distinct systems
last hit 4d ago Script
Script
3
GPTBot
2
Search engines
2

top countries 🇺🇸 United States · 🇫🇷 France · 🇩🇪 Germany · 🇮🇳 India · 🇨🇦 Canada