PYPI PACKAGE AUDIT v0.1.0 Healthy Package

binal

Declarative, type-safe binary modeling for Python.

PyPkgScore binal
Methodology & Criteria ♥ Donate
755 / 1000
Quick Install
pip install binal
1. Governance
100/200
2. PEP Metadata
150/200
3. Security
200/200
4. Docs & SEO
105/200
5. CI Engineering
200/200
📣 Share Audit: Share this report and visual preview in the current language
Advertisement
PYPI TELEMETRY

Downloads & Community Adoption

Last 30 days (without mirrors)
Last 7 days
287
Last 30 days
287
Total (180 days)
287
Metric / Ecosystem Status / Value Source
Downloads (30d / 180d) — PyPI Stats (without mirrors)
Trusted Publishing (PEP 740) ✓ Verified OIDC PyPI Integrity / Sigstore
Django Packages — djangopackages.org
PyTech / PyPkgScore 755 / 1000 PyPkgScore Engine

Health & Engineering Analysis (5 Pillars)

1. Governance & Community100 / 200 ▾
LICENSE✓ 50 pts
SECURITY.md✕ 0 pts
CONTRIBUTING.md✓ 50 pts
CODE_OF_CONDUCT.md✕ 0 pts
2. PEP Metadata & Packaging150 / 200 ▾
Wheel (.whl)✓ 50 pts
pyproject.toml✓ 50 pts
Project URLs✓ 50 pts
Trove Classifiers✕ 0 pts
3. Security & Supply Chain200 / 200 ▾
Zero CVEs (OSV)✓ 60 pts
Trusted Publishing (OIDC)✓ 50 pts
Snyk / Audit Link✓ 40 pts
HTTPS Repository✓ 50 pts
4. Documentation, SEO & Ecosystem105 / 200 ▾
Structured README✓ 60 pts
Read the Docs✕ 0 pts
Django Packages✕ 0 pts
Website / Technical Articles✓ 45 pts
5. Engineering, CI & Quality200 / 200 ▾
Automated Tests✓ 65 pts
GitHub Actions CI✓ 65 pts
CHANGELOG.md✓ 35 pts
Env & Lockfile (uv/rye/poetry/pdm/hatch)✓ 35 pts
Advertisement
README & DOCS

Official Documentation & Usage Guide — binal

PyPI Metadata v0.1.0
Show full original documentation (English README) ▾

Binal

Declarative, type-safe binary modeling for Python.

Binal is a pure-Python library for defining, encoding, decoding, validating, and composing binary data structures using native Python classes and type annotations.

It provides a unified binary modeling system that eliminates repetitive serialization logic, manual buffer management, offset calculations, bitwise operations, and structural validation.

The data model serves as the single source of truth for both Python objects and their binary representations.

Installation

Requires Python 3.11+.

uv add binal
pip install binal

Quick Start

from typing import Annotated

from binal import BinaryModel, Prefixed, UInt8, UInt16


class Packet(BinaryModel, byte_order="big"):
    version: UInt8
    payload: Annotated[bytes, Prefixed(UInt16)]


packet = Packet(version=1, payload=b"Hello")
data = packet.encode()
# b'\x01\x00\x05Hello'
packet = Packet.decode(data)
# Packet(version=1, payload=b'Hello')

Features

  • Declarative models with native type annotations
  • Integers (including custom widths), floats, booleans, bytes, strings, and bit fields
  • Nested models, collections, enums, and tagged unions
  • Length-prefixed, fixed-length, null-terminated, and length-dependent fields
  • Derived lengths, counts, and checksums (CRC32, CRC16, Adler32)
  • Conditional and dependent fields
  • Variable-length integers: ULEB128, SLEB128, ZigZag
  • Schema introspection with field offsets and sizes
  • File, buffer, stream, and asynchronous I/O
  • Structured errors with field paths and byte offsets
  • Zero runtime dependencies, pure Python

See the documentation and examples/ for more.

Development

uv sync --locked
uv run ruff format
uv run ruff check
uv run pyright
uv run pytest
uv run pytest --cov=binal
uv build

License

MIT. See LICENSE.