skillfed

binapy

Binary Data manipulation, for humans.

binapy v0.8.0 1.0M downloads/30d#4,526 on PyPI3
Permissive license MIT DORMANT released

What it is and what it does

BinaPy is a thin wrapper around Python's standard binary-handling modules (hashlib, base64, zlib, urllib.parse, json, pickle) that chains operations through a fluent interface. Instead of calling separate functions or methods in sequence, you chain `.to()` and `.decode_from()` calls on a BinaPy object (which is itself a bytes subclass), making code more readable when performing multiple encoding, compression, or hashing steps in sequence.

The package targets developers who work with binary data transformations—encoding to base64url, compressing with gzip or deflate, hashing with SHA256, URL-encoding, and similar tasks. It does not add new functionality beyond what the standard library offers; it reorganizes and chains existing operations. The single runtime dependency is typing-extensions, and it supports Python 3.8 through 3.12.

Use it for:

  • Chain multiple encoding steps (e.g., compress then base64-encode) in a single readable expression.
  • Simplify hash computation with optional salt by calling a single method instead of hashlib boilerplate.
  • Decode layered data (e.g., base64url-wrapped deflate-compressed JSON) by chaining decode_from calls.
  • Extend the library with custom formats by subclassing or registering new codecs.
  • Reduce repetitive imports and function calls when working with standard compression and encoding formats.

Worth the install?

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

BinaPy wraps Python's binary-handling libraries (hashlib, base64, zlib, urllib.parse, json, pickle) into a fluent, chainable interface for encoding, decoding, compressing, and hashing data.

Yes, if you frequently chain multiple binary transformations and prefer a fluent API over repeated standard-library calls. No, if you only use one or two encoding/hashing operations per script—the standard library is already straightforward and requires no dependency. Caution: Pre-Alpha status and dormant maintenance (last release January 2024) mean the API may change and bugs may not be addressed quickly.

Install

binapy on PyPI

pip

pip install binapy

uv

uv add binapy

poetry

poetry add binapy

Installing binapy

Before you install

Low install friction; single pure-Python dependency (typing-extensions). Maintenance is dormant—last release January 2024, last commit August 2024, repository not archived but showing minimal activity. Pre-Alpha status (Development Status :: 2) suggests the API may still shift.

License in practice

MIT license (permissive) places no restrictions on use, modification, or distribution in your own projects.

Quickstart

from binapy import BinaPy

# Compress and encode
bp = BinaPy("Hello, World!").to("deflate").to("b64u")
print(bp)  # b'80jNycnXUQjPL8pJUQQA'

# Decode and decompress
original = bp.decode_from("b64u").decode_from("deflate").ascii()
print(original)  # "Hello, World!"

Verify before relying

  • Whether the fluent interface and method-chaining design actually reduce boilerplate compared to standard library calls in realistic workflows.
  • Performance characteristics relative to direct hashlib/base64/zlib calls, especially for large data.
  • Stability of the API given Pre-Alpha classification and dormant maintenance status.

Package facts

License MIT (permissive)
Python support supports the current Python release (>=3.8)
Install friction low — pure-Python wheel
Runtime dependencies 1 — typing-extensions
Maintenance dormant — 938 days since the last release
Last repo commit
First released
Downloads 1,006,264/month — #4,526 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: binapy-0.8.0-py3-none-any.whl

Development Status :: 2 - Pre-AlphaIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseProgramming Language :: Python :: 3Programming Language :: Python :: 3.10Programming Language :: Python :: 3.11Programming Language :: Python :: 3.12Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9

Tags

binary data encoding decodingbase64 hex compressionfluent bytes manipulationhashlib wrapperdata format conversion
binary-datafluent-interfaceencoding-decoding

More Utilities packages